prisma-auth0-example
prisma-auth0-example copied to clipboard
directive isOwner and isOwnerOrHasRole works at field level but not query level
Using your example code, the field-level isOwner and isOwnerOrHasRole directives are working as expected, but when used a the query level, they don't seem to be restricting the query results to nodes owned by the querying user. In fact, after adding some logging, the directives don't appear to be firing at all on the query level.
Should I expect to be able to restrict query results to nodes owned by the querying user? Do I need to implement a different directive?
Hi Tim,
Thanks for the message and question!
Directive resolvers fire on fields, not on types. I will refactor this repo to use the new Schema Directives API soon. Until then, please check out https://www.apollographql.com/docs/graphql-tools/schema-directives.html and you should be on your way!