-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
Document classpath* location for looking up GraphQL schemas across modules #31772
Comments
It's a classpath ordering problem. Your You can fix the problem by creating your
I'm going to leave this issue open as I think we should consider a different default schema location. What do you think, @bclozel and @rstoyanchev? |
This might be related to spring-projects/spring-graphql#308 (comment) |
Thanks for the link, Brian. That's the same problem indeed, just with a different source of the unwanted |
As of spring-projects/spring-graphql#338, we look in different places for schema vs test request vs client request files, which eliminates a very basic reason to shadowing For the rest, using |
Thanks Rossen, I'll add a similar note in the Spring Boot reference docs, I'll turn this into a documentation issue then. |
Version
Spring Boot 2.7.1
Description
We created a new
itest
source set in Gradle and when we run the test using@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
, seems like the autoconfigure GraphQL components are not provisioned.How to reproduce it
This project contains a pretty simple GraphQL controller, with two tests:
test
source set, using RestAssured to call the GraphQL endpoint, which works fine (HTTP 200)itest
source set, using RestAssured to call the GraphQL endpoint, which doesn't work (HTTP 404)Clues
I did some debugging and found that
ConditionalOnGraphQlSchema
returns true for thetest
source set, and false for theitest
source set, it seems like this line onDefaultGraphQlSchemaCondition
cannot find the GraphQL schema, and therefore, Spring Boot doesn't contribute the Graphql autoconfiguration.My guess is this issue might be for Spring Boot and not Gradle configuration, as other resources work fine, like liquibase changelogs and application.yml files.
The text was updated successfully, but these errors were encountered: