Skip to content

Allow for the file extensions used when scanning for schema definitions to be overridden via configuration properties #134

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

Closed
jhinch-at-atlassian-com opened this issue Sep 17, 2021 · 4 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@jhinch-at-atlassian-com

Currently, GraphQlAutoConfiguration hard codes the file extensions which will be searched when discovering schema definitions. This caused issues when trying to integrate spring-graphql into a project as we were using .graphql files to store GraphQL queries and .graphqls to store schema definitions. This caused the application context to blow up at runtime.

We worked around this problem by moving the queries and schemas into different directories, but having more control over this would be useful considering the directory to scan is already configurable.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 17, 2021
@bclozel bclozel added in: boot-starter type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 17, 2021
@bclozel bclozel self-assigned this Sep 17, 2021
@bclozel bclozel added this to the 1.0.0-M3 milestone Sep 17, 2021
@bclozel
Copy link
Member

bclozel commented Sep 17, 2021

You're right, we should make that configurable.

@rstoyanchev with the upcoming client support, do you think we should change the defaults to consider only "*.graphqls", "*.gqls" for schema files and "*.graphql", "*.gql" for queries?

@rstoyanchev
Copy link
Contributor

"*.graphqls", "*.gqls" sounds good as a default.

@busches
Copy link

busches commented Sep 29, 2021

This appears to be the behavior in 1.0.0-SNAPSHOT. Can we update the documentation to make this clear? https://docs.spring.io/spring-graphql/docs/1.0.0-SNAPSHOT/reference/html/#boot-graphql-schema I had to swap from schema.graphql to schema.graphqls before Spring would start.

@rstoyanchev
Copy link
Contributor

Yes, I've updated the docs. Thanks, @busches!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants