-
Notifications
You must be signed in to change notification settings - Fork 257
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
Federation 2 - Prevents @requires directive to accept fields with arguments - Allow it for Nullable Arguments #1987
Comments
@pcmanus @benweatherman any input on this ? |
Howdy @SidKhanna296! Thanks for the thorough description. Yes, this makes sense to allow |
@benweatherman thanks for the response!! |
howdy @SidKhanna296! I don't have a good idea on when we'll be able to take a look, but I think it'll be sometime soon. Our team is starting to get back from holiday & other commitments, so might hopefully know more next week. Apologies o the delay, and not having a more concrete answer. |
Apologies for the long delay following up on this. I've just pushed #2120 to allow using fields with arguments in |
If such field with arguments is used in a @requires, then that @requires must provide a value for any required argument and may provide a value for any non-required one (like in any normal graphQL selection set). Fixes apollographql#1987
thank you for getting to this @pcmanus !! |
Hi I am trying to upgrade my federated services with Gateway v2 - however while upgrading it I am receiving errors stating that I cannot pass fields / objects to the @requires directive when said field has arguments attached to them
Below is an example of 2 federated services - in Service 2 I have defined a field
test_field
that will require fields defined in Service 1 - And this throws an error saying that the @requires field cannot pass fields/objects that have arguments defined on themExample:
Service 1:
Service 2:
So the above will throw an error for
options { code }
field pass to thetest_field
in Service 2We have a requirement where the options field can be queried with passed arguments to filter out some results
However when resolving the
test_field
we would like to fetch the nested code field of the options object in order to resolve it (if it exist) - It was mentioned #1975 by @pcmanus that these error handling could be relaxedNote: This was working for the prior version (v0 ?) of gateway
The text was updated successfully, but these errors were encountered: