-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for multiple graphql schema files #56
Comments
Thanks @tobiolalusi - this is now fixed and will be available in our first milestone. For now the configuration property must contain actual locations, e.g. Let me know if you had something else in mind! |
My previous location is classpath: schema/schema.graphql. there is no way to make it work in the configuration of the new |
You mean you need to rename your schema file from Once done, the following should work: spring.graphql.schema.locations=classpath:/schema/ |
There are several possible ways to name a GraphQL file. Could be with one of the following extensions: I could create a PR based on the current update that supports the above mentioned extensions, if need be. |
@bclozel I removed the config in my sample now and renamed my folders and schema file to follow the convention. |
@tobiolalusi @hantsy # default value
spring.graphql.schema.location-patterns=classpath:/schema/*.graphqls
# sample configuration
spring.graphql.schema.location-patterns=classpath:/schema/*.graphql, classpath:/graphql/other/*.gql |
I think the way it works currently, based on root location is good and simple. We could expand that slightly to check for the additional suffixes and adapt to what's present. Given the combination of dedicated locations for such GraphQL schema files, as well as the rather specific suffixes, it shouldn't cause any surprises I think. I can't see a good reason for other kinds of files to use such prefixes, and if they do they simply won't parse and it can't go unnoticed. |
Unless, spring-graphql wants to create a standard, which in my opinion isn't a bad idea, the |
Reopening to look for well-known file extensions in the configured locations. |
I think
Maybe can read from a URI in the future to support GraphQL Gateway/Federation. |
The
TypeDefinitionRegistry
provides a.merge(TypedefinitionRegistry)
to be able to merge multiple schema resources. This comes in mostly handy when the developer tries to create multiple graphql schema files to improve readability and simplicity. All these will be merged into one GraphQL schema/TypeDefinitionRegistry.The text was updated successfully, but these errors were encountered: