-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Planning for directive support #156
Comments
My team really needs this feature ASAP 🤣 |
|
#130 (comment)
|
Would it be possible to write our own directives like in Apollo? |
@andy9775 yes we are currently planning to make directives work much the same as resolvers currently do; directives found in a schema will be generated and you will be able to supply your own implementation. |
I've broken these out into smaller cards on the 1.0 board |
Once the new parser lands and we get full support for directives. These things don't need to be in the core runtime, and should be implementable outside. This probably means codegen hooks.
Possible uses:
@resolver
A way to force creating a resolver method for a field, eg
would generate a Name resolver even if the user struct has a Name field.
@rest
,@grpc
,@swagger
These would implement the resolver method for you by binding to an external API.
@hasRole
,@isAdmin
,@isAuthenticated
These act as middleware filters, and should be able block calling the resolver
@resolveString
and all of the graphql-cats directivesThey shouldn't be part of the core, but a way to implement them to test against cats is really high on my list.
@skip
and@include
these are both runtime directives, not schema but there is probably some overlap here and its worth thinking about them.
These are the ones I want. What do you want to see? Lets collect some ideas before rushing into an implementation.
@connection
?Is there some codegen hook that would make dealing with relay style connections easier?
The text was updated successfully, but these errors were encountered: