Skip to content

20.x Backport of PR 3526 and PR 3527 #3530

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

Merged
merged 4 commits into from
Mar 19, 2024

Conversation

dondonz
Copy link
Member

@dondonz dondonz commented Mar 18, 2024

Backport of PR #3526 and PR #3527 which enables introspection to be disabled

Note: version 20 takes us back to the stone age with Java 8

@@ -544,8 +553,9 @@ class IntrospectionTest extends Specification {
def newIntrospectionQuery = IntrospectionQuery.INTROSPECTION_QUERY

then:
oldIntrospectionQuery.replaceAll("\\s+", "") ==
newIntrospectionQuery.replaceAll("\\s+", "")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cosmetic change here

public class NoIntrospectionGraphqlFieldVisibility implements GraphqlFieldVisibility {

@Deprecated // Deprecated since 2024-03-16
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java 8 special: the deprecated annotation in Java 8 doesn't have the "since" argument


when:
ei = ExecutionInput.newExecutionInput(IntrospectionQuery.INTROSPECTION_QUERY)
.graphQLContext(["INTROSPECTION_DISABLED": false]).build()
Copy link
Member Author

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 is Java 9+ so I've stuck in the string as is. Groovy wants the string rather than a ref to the string as the map key.

@dondonz dondonz changed the title 20.x Backport of PR 3526 20.x Backport of PR 3526 and PR 3527 Mar 18, 2024
ALLOWED_FIELD_INSTANCES.put(coordinates("__Type", "inputFields"), 1);
ALLOWED_FIELD_INSTANCES.put(coordinates("__Type", "interfaces"), 1);
ALLOWED_FIELD_INSTANCES.put(coordinates("__Type", "possibleTypes"), 1);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is different to master - in Java 8 there's no Map.of so I have to use this static block like a caveman

@dondonz dondonz merged commit b0127e4 into 20.x Mar 19, 2024
@dondonz dondonz added this to the 20.8 milestone Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants