You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deprecate the introspectionEnabled option and remove it in 15.0.0 #858
SchemaParserOptions.introspectionEnabled(false) turns off introspection with a field visibility that hides every field of the introspection types (__Schema, __Type, ...). Until #849 that was graphql-java's NoIntrospectionGraphqlFieldVisibility, which graphql-java deprecated in v22 (graphql-java/graphql-java#3526):
NoIntrospectionGraphqlFieldVisibility is another way to do this but it does not allow dynamic on or off and it makes the schema invalid according to spec.
Their replacement checks __schema and __type when the query runs and returns an "introspection disabled" error. It has two switches:
Introspection.enabledJvmWide(false) for the whole JVM
Introspection.INTROSPECTION_DISABLED in the GraphQLContext of a single request
We can't use either one from the library. We don't execute requests, so we can't set the context key, and calling enabledJvmWide(false) from SchemaParser would also turn introspection off for every other schema in the app. So #849 swapped NoIntrospectionGraphqlFieldVisibility for the BlockedFields it wraps, which keeps the old behaviour, including its problems. Apps can use the graphql-java switches directly, so we should point them there and drop the option.
What to change
deprecate SchemaParserOptions.Builder.introspectionEnabled(...) and the introspectionEnabled property in a 14.x release, pointing to the two switches
in 15.0.0, remove both, the BlockedFields block in SchemaParser.parseSchemaObjects and the tests in IntrospectionTest that turn it off
Migration
// beforeSchemaParserOptions.newOptions().introspectionEnabled(false)
// after, for the whole JVMIntrospection.enabledJvmWide(false)
// after, per requestExecutionInput.newExecutionInput()
.query(query)
.graphQLContext(mapOf(Introspection.INTROSPECTION_DISABLED to true))
With the graphql-java switches, an introspection query fails with an "introspection disabled" error when it runs, instead of the FieldUndefined validation error it gets now.
Activity