Skip to content

Commit

Permalink
Change default schema location to /graphql/schema.graphqls
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bclozel committed May 11, 2021
1 parent 2d97e32 commit f70e552
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
15 changes: 15 additions & 0 deletions samples/webflux-websocket/.graphqlconfig
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
15 changes: 15 additions & 0 deletions samples/webmvc-http/.graphqlconfig
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}

0 comments on commit f70e552

Please sign in to comment.