dgs-framework
dgs-framework copied to clipboard
fix: GraphiQL may render broken and cannot be fully disabled
Pull request checklist
- [x] Please read our contributor guide
- [x] Consider creating a discussion on the discussion forum first
- [x] Make sure the PR doesn't introduce backward compatibility issues
- [x] Make sure to have sufficient test cases: tests cases already exist to cover not enabling GraphiQL for both MVC and WebFlux. However, the auto configuration for automatic resource discovery is not enabled on such tests. If you'd like this PR to be updated with static resource loading enabled I can do that.
Pull Request type
- [x] Bugfix
Changes in this PR
Fix a few issues with GraphiQL:
- Issue #1135
- Fix an issue where
dgs.graphql.graphiql.enabled
is not recognized as a valid configuration option with WebFlux - Allow GraphiQL to be fully disabled, even if
spring.web.resources.add-mappings
it set totrue
(the default)
Alternatives considered
DGS_GRAPHQL_PATH
is sometimes unset because there's a race condition between Spring's built in static resource handler and DGS' GraphiQL handlers in both Spring MVC and WebFlux. The alternative option to changing the path for graphiql
would be to force applications to configure spring.web.resources.add-mappings
to false
; it defaults to true
.
PR #1167 from another contributor, also says it fixes #1135. However, it looks like a different potential issue related non-ASCII data in queries, rather than a fix for this bug.
@srinivasankavitha any way to get 👀 on this?
Hi @srinivasankavitha , I answered your questions and rebased this on master
. It should be ready. 🙏 Thank you!