Sarath Raavi
Sarath Raavi

Reputation: 21

Disable GraphiQL playground on production in spring boot application

I have added pom dependency in the spring boot application for graphiql playground with the "graphiql-spring-boot-starter-5.0.2.jar" dependency.

Now I would like to disable the playground for the production environment.

And have tried with spring boot applications as below, but none of these options working to disable the GraphiQL endpoint.

  1. graphiql.enabled= false
  2. dgs.graphql.graphiql.enabled=false

Could you please suggest how we could disable GraphiQL?

Upvotes: 0

Views: 1584

Answers (1)

Rajan jha
Rajan jha

Reputation: 400

You can actually add the below configuration in your production profile inside application.yml or application.properties to disable the playground in the production.

I have tested it with com.graphql-java:playground-spring-boot-started:11.0.0

In application.yml

graphql:
 playground:
  enabled: false

In application.properties

graphql.playground.enabled = false

Upvotes: 1

Related Questions