-
Notifications
You must be signed in to change notification settings - Fork 1.2k
20.x Backport PR 3539 #3542
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
20.x Backport PR 3539 #3542
Conversation
| } | ||
| throwAssert(msgFmt, arg1); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backport utils
| @@ -1,10 +1,10 @@ | |||
| package graphql.analysis; | |||
|
|
|||
| import graphql.GraphQLContext; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update file to bring in line with v21 - it's because ConditionalNodes are referenced in the ExecutableNormalizedOperationFactory, and those changes are viral in a few other files
| @@ -1,5 +1,6 @@ | |||
| package graphql.analysis; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update file to bring in line with v21 - it's because ConditionalNodes are referenced in the ExecutableNormalizedOperationFactory, and those changes are viral in a few other files
| @@ -1,5 +1,6 @@ | |||
| package graphql.analysis; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update file to bring in line with v21 - it's because ConditionalNodes are referenced in the ExecutableNormalizedOperationFactory, and those changes are viral in a few other files
| FragmentSpread fragmentSpread = (FragmentSpread) node; | ||
| return singletonList(fragmentsByName.get(fragmentSpread.getName())); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update file to bring in line with v21 - it's because ConditionalNodes are referenced in the ExecutableNormalizedOperationFactory, and those changes are viral in a few other files
| @@ -1,43 +0,0 @@ | |||
| package graphql.execution; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File was moved into it's own directory
| @@ -1,7 +1,8 @@ | |||
| package graphql.execution; | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update file to bring in line with v21 - it's because ConditionalNodes are referenced in the ExecutableNormalizedOperationFactory, and those changes are viral in a few other files
| @@ -1,6 +1,7 @@ | |||
| package graphql.execution; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update file to bring in line with v21 - it's because ConditionalNodes are referenced in the ExecutableNormalizedOperationFactory, and those changes are viral in a few other files
| @@ -0,0 +1,22 @@ | |||
| package graphql.execution.conditional; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bring in line with v21
| @@ -0,0 +1,48 @@ | |||
| package graphql.execution.conditional; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bring in line with v21
| @@ -0,0 +1,102 @@ | |||
| package graphql.execution.conditional; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated ConditionalNodes as it appears in v21
| then: | ||
| def e = thrown(AbortExecutionException) | ||
| // This line is different in version 21+, it is "Maximum field count exceeded. 189 > 188" | ||
| e.message == "Maximum field count exceeded. 188 > 187" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way we count nodes is 1 less in v20 compared to v21 & master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Andi: the reason for this is @oneOf is introduced in v21, so v20 and prior will have 1 less node
| byte[] bytes; | ||
| try (InputStream inputStream = resource.openStream()) { | ||
| // In GraphQL Java version 21 and above, this Guava helper is replaced with Java 9's readAllBytes() | ||
| bytes = ByteStreams.toByteArray(inputStream); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fun one: readAllBytes is only in Java 9 onwards so here's the Guava equivalent. We selectively shade in Guava files (e.g. Immutable objects already in use) so we're alright to use Guava here.
… into 20.x-backport-enf-introspection
Backport of PR #3539
This is a cherry pick of 3539 plus other changes to bring ConditionalNodes and related classes up to date with v21. I chose not to use the master versions of these files as they have references to defer, to be released in v22.
Note that introspection deliberately has 1 node less than v21+, because the new built-in directive
@oneOfis added in version 21.