Skip to content

Commit

Permalink
Merge pull request #1183 from foo4u/srossillo.fix-graphiql-issues
Browse files Browse the repository at this point in the history
fix: GraphiQL may render broken and cannot be fully disabled
  • Loading branch information
srinivasankavitha committed Oct 21, 2022
2 parents 092da25 + b6bf8b6 commit 9c439d3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 2 deletions.
Expand Up @@ -48,6 +48,7 @@ class DgsWebfluxConfigurationProperties(
* Configuration properties for the GraphiQL endpoint.
*/
data class DgsGraphiQLConfigurationProperties(
@DefaultValue("true") var enabled: Boolean = true,
/** Path to the GraphiQL endpoint without trailing slash. */
@DefaultValue("/graphiql") var path: String = "/graphiql",
/** GraphiQL title */
Expand Down
Expand Up @@ -35,7 +35,7 @@ class GraphiQlConfigurer(private val configProps: DgsWebfluxConfigurationPropert
val graphiQLTitle = configProps.graphiql.title
registry
.addResourceHandler(configProps.graphiql.path + "/**")
.addResourceLocations("classpath:/static/graphiql/")
.addResourceLocations("classpath:/graphiql/")
.resourceChain(true)
.addResolver(PathResourceResolver())
.addTransformer(TokenReplacingTransformer(mapOf("<DGS_GRAPHQL_PATH>" to graphqlPath, "<DGS_GRAPHIQL_TITLE>" to graphiQLTitle), configProps))
Expand Down
Expand Up @@ -53,7 +53,7 @@ open class GraphiQLConfigurer(
logger.info("Configuring GraphiQL to use GraphQL endpoint at '{}'", graphqlPath)
registry
.addResourceHandler("/graphiql/**")
.addResourceLocations("classpath:/static/graphiql/")
.addResourceLocations("classpath:/graphiql/")
.setCachePeriod(3600)
.resourceChain(true)
.addResolver(PathResourceResolver())
Expand Down

0 comments on commit 9c439d3

Please sign in to comment.