3

I am following this example here:- http://www.baeldung.com/spring-graphql

for me the GraphQLSchema bean is not getting autoregistered. it throws me this error:- No qualifying bean of type 'graphql.schema.GraphQLSchema' available

my Pom file has all requried Spring boot dependecies:-

graphql-spring-boot-starter
graphql-java-tools
graphiql-spring-boot-starter

I have following settings in application.proerties:-

graphql.root=/v1
graphql.servlet.mapping=${graphql.root}/graphql
graphql.servlet.enabled=true
graphql.servlet.corsEnabled=true

Not sure what am I missing, Do I need to explicitly define this bean as on this page:- https://github.com/graphql-java/graphql-spring-boot/blob/master/example/src/main/java/com/embedler/moon/graphql/boot/sample/ApplicationBootConfiguration.java.

But I thought it will autocreate for me, I just need to have *.graphqls on my class path.

1 Answer 1

1

I have followed the same tutorial as well and encountered the same error. I ended up figuring out what the issue was and it is that you need to add @Component to the Query class that the tutorial describes.

Once that was done graphiql was finally finding the schema and the /graphql end-point was exposed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.