prisma-auth0-example icon indicating copy to clipboard operation
prisma-auth0-example copied to clipboard

directive isOwner and isOwnerOrHasRole works at field level but not query level

Open timchambers opened this issue 6 years ago • 1 comments

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?

timchambers avatar Jun 22 '18 19:06 timchambers

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!

LawJolla avatar Jun 23 '18 04:06 LawJolla