Add property for disabling GraphQL schema introspection
Prior to this commit, the GraphQL schema assembled by the auto-configuration would provide no option for disabling the field introspection. While this feature is essential for many tools (including GraphiQL), some prefer disabling it because this allows clients to gather information about types and schema easily. This commit introduces a new `spring.graphql.schema.introspection.enabled` configuration property. Because potential attackers can still gather this information and this feature is a core concern in the GraphQL spec, introspection is enabled by default for Spring Boot applications. Closes gh-29248
This commit is contained in:
@@ -40,6 +40,8 @@ In the following sections, we'll consider this sample GraphQL schema, defining t
|
||||
include::{docs-resources}/graphql/schema.graphqls[]
|
||||
----
|
||||
|
||||
NOTE: By default, https://spec.graphql.org/draft/#sec-Introspection[field introspection] will be allowed on the schema as it is required for tools such as GraphiQL.
|
||||
If you wish to not expose information about the schema, you can disable introspection by setting configprop:spring.graphql.schema.introspection.enabled[] to `false`.
|
||||
|
||||
[[web.graphql.runtimewiring]]
|
||||
=== GraphQL RuntimeWiring
|
||||
|
||||
Reference in New Issue
Block a user