diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlProperties.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlProperties.java index 9032b899..91ce87f3 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlProperties.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlProperties.java @@ -98,11 +98,6 @@ public class GraphQlProperties { */ private boolean enabled = false; - /** - * Path under the main GraphQL path where the schema is exposed. - */ - private String path = "/schema"; - public boolean isEnabled() { return this.enabled; } @@ -111,14 +106,6 @@ public class GraphQlProperties { this.enabled = enabled; } - public String getPath() { - return this.path; - } - - public void setPath(String path) { - this.path = path; - } - } } diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlWebFluxAutoConfiguration.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlWebFluxAutoConfiguration.java index 5d546f11..2f126ac6 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlWebFluxAutoConfiguration.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlWebFluxAutoConfiguration.java @@ -20,7 +20,6 @@ import java.util.Collections; import java.util.stream.Collectors; import graphql.GraphQL; -import graphql.schema.idl.SchemaPrinter; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -115,8 +114,7 @@ public class GraphQlWebFluxAutoConfiguration { if (properties.getSchema().getPrinter().isEnabled()) { SchemaHandler schemaHandler = new SchemaHandler(graphQlSource); - String schemaPath = properties.getSchema().getPrinter().getPath(); - builder = builder.GET(graphQLPath + schemaPath, schemaHandler::handleRequest); + builder = builder.GET(graphQLPath + "/schema", schemaHandler::handleRequest); } return builder.build(); diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlWebMvcAutoConfiguration.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlWebMvcAutoConfiguration.java index 9732c7e0..51553c37 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlWebMvcAutoConfiguration.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQlWebMvcAutoConfiguration.java @@ -124,8 +124,7 @@ public class GraphQlWebMvcAutoConfiguration { if (properties.getSchema().getPrinter().isEnabled()) { SchemaHandler schemaHandler = new SchemaHandler(graphQlSource); - String schemaPath = properties.getSchema().getPrinter().getPath(); - builder = builder.GET(graphQLPath + schemaPath, schemaHandler::handleRequest); + builder = builder.GET(graphQLPath + "/schema", schemaHandler::handleRequest); } return builder.build(); diff --git a/spring-graphql-docs/src/docs/asciidoc/index.adoc b/spring-graphql-docs/src/docs/asciidoc/index.adoc index 96171c54..f300d0ae 100644 --- a/spring-graphql-docs/src/docs/asciidoc/index.adoc +++ b/spring-graphql-docs/src/docs/asciidoc/index.adoc @@ -183,7 +183,8 @@ schema locations to check as follows: spring.graphql.schema.locations=classpath:graphql/ ---- -The GraphQL schema can be viewed over HTTP at "/graphql/schema", if enabled: +The GraphQL schema can be viewed over HTTP at "/graphql/schema", relative to the main graphql endpoint path. +It is disabled by default: [source,properties,indent=0,subs="verbatim,quotes"] ----