-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: GraphiQL may render broken and cannot be fully disabled #1183
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ class GraphiQlConfigurer(private val configProps: DgsWebfluxConfigurationPropert | |
val graphiQLTitle = configProps.graphiql.title | ||
registry | ||
.addResourceHandler(configProps.graphiql.path + "/**") | ||
.addResourceLocations("classpath:/static/graphiql/") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For my understanding, could you explain why moving the location out of the static directory addresses the race condition? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So, Spring attempts to serve all assets under From my understanding about Spring, it's best NOT to store templates that require server side rendering in |
||
.addResourceLocations("classpath:/graphiql/") | ||
.resourceChain(true) | ||
.addResolver(PathResourceResolver()) | ||
.addTransformer(TokenReplacingTransformer(mapOf("<DGS_GRAPHQL_PATH>" to graphqlPath, "<DGS_GRAPHIQL_TITLE>" to graphiQLTitle), configProps)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used by Spring's metadata generator. The property isn't used directly by DGS b/c it's referred to in full dot notation as a
@Conditional
. This is mainly useful for IDE autocompletion.dgs-framework/graphql-dgs-spring-webflux-autoconfigure/src/main/kotlin/com/netflix/graphql/dgs/webflux/autoconfiguration/DgsWebFluxAutoConfiguration.kt
Lines 144 to 147 in 8fa2368