Change default schema location to /graphql/schema.graphqls

This commit changes the default location for the GraphQL schema from
`classpath:schema.graphqls` to `classpath:/graphql/schema.graphqls`.

We're also adding `.graphqlconfig` files that are leveraged by a GraphQL
JS plugin in IntelliJ IDEA.

Closes gh-44
This commit is contained in:
Brian Clozel
2021-05-11 15:52:58 +02:00
parent 2d97e326e2
commit f70e552c6a
6 changed files with 32 additions and 2 deletions

View File

@@ -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

View File

@@ -52,7 +52,7 @@ public class GraphQLProperties {
/**
* 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();

View File

@@ -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
}
}
}
}

View File

@@ -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
}
}
}
}