You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 17, 2023. It is now read-only.
Adding example documenation for using apollo-server-express v3 directive transformers since this lib cant provide them as of now due to dependency issues. (#133)
Copy file name to clipboardExpand all lines: README.md
+110Lines changed: 110 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,6 +200,116 @@ Both the `@hasPermission` schema directive and the exported `hasPermission` func
200
200
* If a single string is provided, it returns true if the keycloak user has a permission for requested resource and its scope, if the scope is provided.
201
201
* If an array of strings is provided, it returns true if the keycloak user has **all** requested permissions.
202
202
203
+
## Apollo Server Express 3+ Support
204
+
205
+
`apollo-server-express@^3.x` no longer supports the `SchemaDirectiveVisitor` class and therefor prevents
206
+
you from using the visitors of this library. They have adopted schema
207
+
[transformers functions](https://www.apollographql.com/docs/apollo-server/schema/creating-directives/) that define behavior
208
+
on the schema fields with the directives.
209
+
210
+
Remediating this is actually rather simple and gives you the option of adding a bit more authentication logic if needed,
211
+
but will require some understanding of the inner workings of this library.
212
+
213
+
To make things easy, this is an example implementation of what the transformers may look like. (Note the validation of roles and permissions
0 commit comments