-
Notifications
You must be signed in to change notification settings - Fork 22
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
graphql doesn't support directive with default value and mismatch with gqlparser #40
Comments
Hey @zhangtbj, thank you for the issue. I'll take a look soon. If you happen to have a minimal test that can reproduce this failure, that would be super helpful to verify the fix. |
Thanks for the quick response @JohnStarich 👍 . No problem, I think the problem is also related the issue #33 You can write a very simple example like this:
Then debug it step by step, you will find: After loading the remote schema, there are 4 directives, and one of the directives
|
@zhangtbj (likely) fix is merged and released in |
Awesome! Thanks for the quick fix 👍 Cool and let me try it soon :) |
BTW, I verified on our env, that the fix works fine and the problem has been solved. Thanks a lot! :) 👍 |
Hi,
I am using the nautilus
gateway
andgraphql
as our gateway server.Recently, we received a vulnerability report that:
We have to upgrade the
gqlparser
version for security reason, but after we upgrade the version, the nautilus gateway cannot startup correctly, it reports a failure during the startup:After the investigation, I found the reason is
gqlparser
add a new directive defer in its inner schema after releasev2.5.2
(But nautilus graphql is still using the v2.0.1:https://github.com/vektah/gqlparser/blob/v2.5.2/validator/prelude.graphql#L31
directive @defer(if: Boolean = true, label: String) on FRAGMENT_SPREAD | INLINE_FRAGMENT
After adding this
directive @defer
and with the default Boolean valuetrue
, the graphql introspection cannot match its default value because it doesn't support to set the default value for the argument of directive:https://github.com/nautilus/graphql/blob/master/introspection.go#L340-L344
So the failure will happen during the multiple schema merge:
https://github.com/nautilus/gateway/blob/master/merge.go#L607-L609
So I prepared a workaround to add default value if it exists, it works fine for me, but I think it is not an official fix:
zhangtbj@c0d6961
I am not sure if it can be fixed by nautilus graphql community officially or do you have any other good idea?
I am not sure who can help here, so cc @JohnStarich for help too.
Thanks a lot!
The text was updated successfully, but these errors were encountered: