SpringBoot GraphQL Not exposing /graphql endpoint

SpringBoot GraphQL Not exposing /graphql endpoint


2

Currently trying to setup SpringBoot and GraphQL but whenever I run the application I don’t seem to get the /graphql endpoint exposed, nor does the graphiql UI get exposed when I set it to enabled in the application.yml file.

I’ve also tried setting the endpoint manually in the properties but that also isn’t exposed.

I’ve pushed up the code to github below as I can’t work out where the problem would be.

https://github.com/RyanMoss96/spring-boot-graphql

2

  • Your project doesn't start (problem with the Entity definition). If you fix the entity issue then it starts and both /graphql and /graphiql endpoints work.

    – F. Salvini

    Jul 31, 2022 at 21:29

  • Maybe it's due schema.graphqls is not copied into the jar during build process. I have same issue and discovered schema.graphqls is missing in my build jar

    – komizo

    Aug 8 at 14:23

3 Answers
3


0

graphql.servlet.mapping=/graphql

Add this information to application.yaml


0

In my case, I had a typo in my GraphQL schema file name: its .graphqls not .graphql. Spring did not discover it and therefore not expose it automatically.


0

I think you need to downgrade the version. If you’re using Spring Boot, use 2.7.x. It may work



Leave a Reply

Your email address will not be published. Required fields are marked *