schemaDirective on Input fields not working #2418
Unanswered
fridaystreet
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I realise graphql-modules has moved on from schemaVisitor, but we had a lot of directives built with this pattern when it was dropped and haven't had a chance to look into how to migrate. Just hoping there are others in same boat who might be able to assist.
We have directives all working fine but when we try and run then against an input field, the 'visitInputFieldDefinition' is called but both the subscribe and resolve fields are undefined, so the directive is never called for those fields.
Some code: this is an authorisation directive that allows a check for authroisation and puses the authgraph for the users request into the params to be used further by the providers etc. the problem is that 'const { resolve, subscribe } = field;' both resolve and subscribe are undefined when it's an input field
directive
the schema definition
The main App (applying the directives)
And then we finally use
before passing the schema to apollo
Any assitsance greatly appreciated
Beta Was this translation helpful? Give feedback.
All reactions