Skip to content
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

GraphQL Schema not found when project is a gradle multi module #1123

Open
andimarek opened this issue Feb 15, 2025 · 3 comments
Open

GraphQL Schema not found when project is a gradle multi module #1123

andimarek opened this issue Feb 15, 2025 · 3 comments
Assignees
Labels
status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged

Comments

@andimarek
Copy link
Contributor

Hi,

not sure really this is a spring problem or a Gradle/IDEA problem, but when you have a Gradle multi module project and one of the modules is your Spring GraphQL app, then loading a GraphQL schema from the resources classpath fails (DefaultGraphQlSchemaCondition can't find it).

I created a minimal project to observe that here: https://github.com/andimarek/spring-graphql-multimodule-test

Just import in IDEA and run it. The result is that the GraphQL schema file resources/graphql/schema.graphqls is not found and hence so GraphQL setup/bootstrapping takes place.

Cheers

@bclozel
Copy link
Member

bclozel commented Feb 16, 2025

Hey Andi

This sounds similar to #117 as this happens in an IDE and your application is using the "graphql" top level package.

You can configure a different schema location like "classpath*:graphql/". I would still suggest to use a different package namespace to avoid split packages issues with graphql-java.

Let us know if this works and if you got a failure analyzer message as in #117. We can refine this case a bit more based on your feedback.

@bclozel bclozel added status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Feb 16, 2025
@andimarek
Copy link
Contributor Author

I remember the other discussion, but what is a bit strange is that it works in a normal gradle project. Only when I move it to multi module it breaks.

@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Feb 23, 2025
@bclozel bclozel added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Feb 23, 2025
@bclozel bclozel self-assigned this Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants