-
Notifications
You must be signed in to change notification settings - Fork 1.1k
19.x Backport #3526 and PR #3527 #3532
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
Conversation
return errorClassification; | ||
} | ||
}; | ||
} |
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.
I also backported this convenience method to make the backport easier - it's in v20 onwards
public class NoIntrospectionGraphqlFieldVisibility implements GraphqlFieldVisibility { | ||
|
||
@Deprecated // (since = "2024-03-16") |
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.
Java 8 special: since is not an argument for the Deprecated annotation, so it's a comment
This was added in Java 9. v21 uses Java 11.
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.
nice
|
||
when: | ||
ei = ExecutionInput.newExecutionInput(IntrospectionQuery.INTROSPECTION_QUERY) | ||
.graphQLContext(["INTROSPECTION_DISABLED": false]).build() |
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.
Java 8 special: Map.of was introduced in Java 9, so using the Groovy way instead
@NotNull | ||
private static Optional<ExecutionResult> mkDisabledError(MergedField schemaField) { | ||
IntrospectionDisabledError error = new IntrospectionDisabledError(schemaField.getSingleField().getSourceLocation()); | ||
return Optional.of(ExecutionResultImpl.newExecutionResult().addError(error).build()); |
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.
v19 API difference: this builder method is moved in v20 onwards
ImmutableList<ExecutableNormalizedField> normalizedFields = coordinatesToENFs.get(coordinates); | ||
if (normalizedFields.size() > allowSize) { | ||
BadFaithIntrospectionError error = new BadFaithIntrospectionError(coordinates.toString()); | ||
return Optional.of(ExecutionResultImpl.newExecutionResult().addError(error).build()); |
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.
Slight difference to master: this builder has changed file location
For v19 it is inside ExecutionResultImpl
ALLOWED_FIELD_INSTANCES.put(coordinates("__Type", "inputFields"), 1); | ||
ALLOWED_FIELD_INSTANCES.put(coordinates("__Type", "interfaces"), 1); | ||
ALLOWED_FIELD_INSTANCES.put(coordinates("__Type", "possibleTypes"), 1); | ||
} |
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.
Java 8 alert: there is no Map.of until Java 9 so I am using a static block like a caveman
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.
Nice one - will the max nodes go in here
I'll add it in a separate PR |
Backport of #3526 and PR #3527 - pulls in introspection disabling and Good Faith Introspection
Remember we're back in the stone age with Java 8, small adjustments for this