Netflix / dgs-framework

GraphQL for Java with Spring Boot made easy.
https://netflix.github.io/dgs
Apache License 2.0
3.06k stars 295 forks source link

bug: config dgs.graphql.graphiql.path not working #455

Closed brianlschultz1969 closed 1 week ago

brianlschultz1969 commented 3 years ago

Expected behavior

Changing the config "dgs.graphql.graphiql.path" should change graphiql endpoint

Changing to something like: dgs.graphql.graphiql.path: /personalize/graphiql

Should allow access like: http://localhost:8080/personalize/graphiql/

Actual behavior

The default config value (/graphiql) is always used http://localhost:8080/graphiql/

Steps to reproduce

  1. Add config to application.yml: dgs.graphql.graphiql.path: /personalize/graphiql
  2. Restart application
  3. Open browser - enter url http://localhost:8080/personalize/graphiql/
  4. Get a 404 error
  5. Note: A test case would be highly appreciated, but we understand that's not always possible

brianlschultz1969 commented 3 years ago

Looks like this is related to me using the webflux package - com.netflix.graphql.dgs:graphql-dgs-webflux-starter

Looks like the DgsWebfluxConfigurationProperties does not contains the graphiql config like the DgsWebMvcConfigurationProperties does

mdecastilho commented 3 years ago

It's not working when you configure the WebFlux base path as well: spring.webflux.base-path: some-path.

Can we append the path to the configuration as you are doing for the WebMvc, or am I missing some important detail?

brianlschultz1969 commented 3 years ago

I just tried that but it ends up having another side effect.

spring.webflux.base-path: /personalize

The graphiql path now works with new url (i.e. http://localhost:8080/personalize/graphiql/index.html)

But now the graphiql is trying to call itself instead of "graphql" when submitting requests from the graphiql UI and I get 404 not found

Very odd.

jessepinkman9900 commented 2 years ago

has this issue been fixed? i am unable to access "/graphiql" when i change dep from com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter to com.netflix.graphql.dgs:graphql-dgs-subscriptions-websockets-autoconfigure along with platform("com.netflix.graphql.dgs:graphql-dgs-platform-dependencies:4.8.0")

pj28105 commented 1 year ago

Is this issue fixed ?

Not able to access /graphql & /graphiql endpoints.

paulbakker commented 1 week ago

Closing as this is not reproducible. Also this is now handled by Spring Graphql. See https://netflix.github.io/dgs/spring-graphql-integration/.