Netflix / dgs-framework

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

bug: dgs.graphql.path is not working in 8.7.1 & 9.0.0 versions with spring integration #1931

Closed dusinof closed 3 weeks ago

dusinof commented 4 weeks ago

Hi,

maybe I',m doing something wrong but with new dependency com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter the property dgs.graphql.path is not working.

Expected behavior

graphql endpoint should be on localhost:port/dummy/graphql

Actual behavior

graphql endpoint is wrongly available on: localhost:port/graphql

Steps to reproduce

Simply modify the application.properties file and change the value to: dgs.graphql.path=/dummy/graphql

Workaround:

use spring.graphql.path=/dummy/graphql instead

The property dgs.graphql.path is working with old dependencycom.netflix.graphql.dgs:graphql-dgs-spring-boot-starter

kailyak commented 4 weeks ago

Hello, thank you for reporting this behavior. I am able to reproduce and am investigating further. In the meantime, using spring-graphql's custom graphql path application property spring.graphql.path when on the dgs spring-graphql integration dependency sets the custom path as you described, please continue using that.

paulbakker commented 4 weeks ago

I think we missed mapping this property here: https://github.com/Netflix/dgs-framework/blob/master/graphql-dgs-spring-graphql/src/main/kotlin/com/netflix/graphql/dgs/springgraphql/autoconfig/DgsSpringGraphQLEnvironmentPostProcessor.kt#L33

It's mapping the property for the graphiql path, but not the graphql endpoint path.

kailyak commented 4 weeks ago

Thanks @paulbakker! I tested it out and adding the mapping for the graphql path property does yield the expected behavior of setting a custom graphql endpoint when the dgs.graphql.path configuration property is set in the dgs spring-graphql integration. @dusinof, the fix for this should be available in the next or subsequent dgs-framework release.