Load multiple GraphQL schema files

Prior to this commit, the `spring.graphql.schema.location` would only
allow a single file as the source for the GraphQL schema.

This commit changes this configuration to
`spring.graphql.schema.locations` so that it accepts actual locations
(folders) and scans for `*.graphqls` files in those locations. All files
are parsed and merged as a single GraphQL `TypeDefinitionRegistry`.

Closes gh-56
This commit is contained in:
Brian Clozel
2021-06-29 21:27:18 +02:00
parent f29c5ba764
commit fdf446f3e6
11 changed files with 66 additions and 37 deletions

View File

@@ -119,8 +119,8 @@ The Spring GraphQL project offers a few configuration properties to customize yo
````properties
# web path to the graphql endpoint
spring.graphql.path=/graphql
# location of the graphql schema file
spring.graphql.schema.location=classpath:graphql/schema.graphqls
# locations of the graphql '*.graphqls' schema files
spring.graphql.schema.locations=classpath:graphql/
# schema printer endpoint configuration
# endpoint path is concatenated with the main path, so "/graphql/schema" by default
spring.graphql.schema.printer.enabled=false