Update gqlparser v2 to v2.5.22 to Support @oneOf and @deprecated on input values#3507
Merged
StevenACoffman merged 4 commits intomasterfrom Jan 27, 2025
Merged
Update gqlparser v2 to v2.5.22 to Support @oneOf and @deprecated on input values#3507StevenACoffman merged 4 commits intomasterfrom
@oneOf and @deprecated on input values#3507StevenACoffman merged 4 commits intomasterfrom
Conversation
Signed-off-by: Steve Coffman <steve@khanacademy.org>
@oneOf and @deprecated on input values
Signed-off-by: Steve Coffman <steve@khanacademy.org>
Signed-off-by: Steve Coffman <steve@khanacademy.org>
Signed-off-by: Steve Coffman <steve@khanacademy.org>
|
Nice! Any idea when this will be released? |
Collaborator
Author
|
@peter-svensson I released https://github.com/99designs/gqlgen/releases/tag/v0.17.64 a few minutes ago. Sorry for the awkward period where upgrading gqlparser would break gqlgen. 😞 |
No worries what so ever! Thanks for the great work! |
4 tasks
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solved: Support
@oneOfand@deprecatedon input valuesSome folks (e.g. @CodingContraption ) ran into a problem recently with graphql-protect by @ldebruijn when used to protect an apollo-router GraphQL API.
The latest apollo-router supports a draft version of the GraphQL spec and that draft adds support for deprecated input values: graphql/graphql-spec#805
gqlparser v2.5.1 support was still at an earlier version of the GraphQL spec, resulting in errors when a client requests introspection fields like
isDeprecatedanddeprecationReasonon the__InputValue.To fix this, in the gqlparser
prelude.graphqlwas updated to match the draft introspection schema and the reference graphql-js implementation. This included a few updated validation rules. This was done in vektah/gqlparser#342 andthen github.com/vektah/gqlparser/v2 v2.5.2 was released, but now when updating gqlparser in gqlgen, I am finding a number of problems.
The last time there was a major GraphQL spec version support bump in gqlparser, gqlgen required some modifications #1982 so it may be that we need some modifications here in gqlgen, or it may be we need some tweaks to gqlparser or maybe both.
In this particular case, it looks like the gqlparser change is currently causing the generated ResolverRoot interface go from this:
To this:
Which is causing this problem:
This now looks like:
Adding
IsDeprecatedwas last touched in #455 so that might provide a model for how to support these changes.Updated: Ok, it looks like it was pretty straightforward after all, following those two prior PR examples.
Signed-off-by: Steve Coffman steve@khanacademy.org