Replies: 1 comment
-
What do you mean by executing directives? Could you give a code example or reproduction on CodeSandbox? Thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In prior versions, (at least 7.x) it was possible to create a directive that called resolve(), e.g.
directive @protect(featureSets: [FeatureSet!]!) on FIELD_DEFINITION | ARGUMENT_DEFINITION
which could be used like
myBulletins( limit: Int = 100 @auth @protect(featureSets: [TALENT, COORDINATOR, PLANNER, ADMIN]) ): [Bulletin!]! @auth
and it was possible to resolve GraphQL context when executing the directive. I am not 100% sure it ever worked, but at least it did compile and the types permitted that. As per the new API, this is no longer possible.
In our use case, we would like to restrict the usage of certain parameters by directives, where the actual role of the user (as in this sample) is inferred from context. How might I do this with the new API?
Beta Was this translation helpful? Give feedback.
All reactions