diff --git a/README.md b/README.md index 04d320323..b4b0c7477 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ The Spring GraphQL project offers a few configuration properties to customize yo # web path to the graphql endpoint spring.graphql.path=/graphql # location of the graphql schema file -spring.graphql.schema.location=classpath:/schema.graphqls +spring.graphql.schema.location=classpath:graphql/schema.graphqls # schema printer endpoint configuration # endpoint path is concatenated with the main path, so "/graphql/schema" by default spring.graphql.schema.printer.enabled=false 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 ec07d7a3b..eedc73d75 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 @@ -52,7 +52,7 @@ public static class Schema { /** * Location of the GraphQL schema file. */ - private String location = "classpath:schema.graphqls"; + private String location = "classpath:graphql/schema.graphqls"; private final Printer printer = new Printer(); diff --git a/samples/webflux-websocket/.graphqlconfig b/samples/webflux-websocket/.graphqlconfig new file mode 100644 index 000000000..258ce3891 --- /dev/null +++ b/samples/webflux-websocket/.graphqlconfig @@ -0,0 +1,15 @@ +{ + "name": "Spring WebFlux+WebSocket GraphQL Sample Schema", + "schemaPath": "src/main/resources/graphql/schema.graphqls", + "extensions": { + "endpoints": { + "Local GraphQL Endpoint": { + "url": "http://localhost:8080/graphql", + "headers": { + "user-agent": "JS GraphQL" + }, + "introspect": false + } + } + } +} \ No newline at end of file diff --git a/samples/webflux-websocket/src/main/resources/schema.graphqls b/samples/webflux-websocket/src/main/resources/graphql/schema.graphqls similarity index 100% rename from samples/webflux-websocket/src/main/resources/schema.graphqls rename to samples/webflux-websocket/src/main/resources/graphql/schema.graphqls diff --git a/samples/webmvc-http/.graphqlconfig b/samples/webmvc-http/.graphqlconfig new file mode 100644 index 000000000..e74b793d1 --- /dev/null +++ b/samples/webmvc-http/.graphqlconfig @@ -0,0 +1,15 @@ +{ + "name": "Spring MVC GraphQL Sample Schema", + "schemaPath": "src/main/resources/graphql/schema.graphqls", + "extensions": { + "endpoints": { + "Local GraphQL Endpoint": { + "url": "http://localhost:8080/graphql", + "headers": { + "user-agent": "JS GraphQL" + }, + "introspect": false + } + } + } +} \ No newline at end of file diff --git a/samples/webmvc-http/src/main/resources/schema.graphqls b/samples/webmvc-http/src/main/resources/graphql/schema.graphqls similarity index 100% rename from samples/webmvc-http/src/main/resources/schema.graphqls rename to samples/webmvc-http/src/main/resources/graphql/schema.graphqls