Enable GraphiQL UI by default with Devtools

GraphiQL is useful when working on a GraphQL API - it allows
developers to craft queries and test newly developed feature. This
is not enabled by default, as this should not be exposed in production
without the developer's knowledge.

This commit flips this value when Spring Boot devtools is active for a
better developer experience.

See gh-29140
This commit is contained in:
Brian Clozel 2021-12-21 08:33:31 +01:00
parent 6ef1ed0dd0
commit ce6747ccd6
1 changed files with 1 additions and 0 deletions

View File

@ -63,6 +63,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
Map<String, Object> properties = new HashMap<>(); Map<String, Object> properties = new HashMap<>();
properties.put("spring.thymeleaf.cache", "false"); properties.put("spring.thymeleaf.cache", "false");
properties.put("spring.freemarker.cache", "false"); properties.put("spring.freemarker.cache", "false");
properties.put("spring.graphql.graphiql.enabled", "true");
properties.put("spring.groovy.template.cache", "false"); properties.put("spring.groovy.template.cache", "false");
properties.put("spring.mustache.cache", "false"); properties.put("spring.mustache.cache", "false");
properties.put("server.servlet.session.persistent", "true"); properties.put("server.servlet.session.persistent", "true");