-
Notifications
You must be signed in to change notification settings - Fork 237
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
@requires directive not found in gateway list of directives #729
Comments
Good spot! Would you like to send a Pull Request to address this issue? Remember to add unit tests. |
Sure thing! It isn't quite clear to me in the codebase where the omitting of Line 20 in bc83aad
I'll start there and comment back when I see a clear path forward. |
The reason this happens is that the gateway-specific directives are filtered out of the final list of directives here: Line 240 in ea2e50d
This is because they aren't used in the final gateway schema, except the |
Hi!
My team writes the gateway schema to disk for a number of reasons. We like seeing what our federated graph schema compiles to and its nice for communicating what the schema looks like to other teams (we dont use a schema registry).
We recently started to use the
@requires
directive in a service and the gateway doesn't list it in the directives available. Because of this,@requires
does not get defined at the top of the schema file even though its being used in the schema. This breaks our linting and also doesn't follow the GraphQL schema spec closely.Functionally
@requires
works as expected for the federated services.Steps to reproduce
Create a new node project on your computer.
Copy and paste the example gateway code from the repo into a index.js file.
Run the gateway and the two services (does this by default) by running
node index.js
.Query the gateway for directives
See that no requires directive will exist
Query service 2 for directives
See that the
@requires
directive existsHere is the query you can run to get directives.
The text was updated successfully, but these errors were encountered: