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: unmapped fields after switching to Spring GraphQL integration #1906

Closed ychescale9 closed 1 month ago

ychescale9 commented 1 month ago

Expected behavior

No issue after switching to Spring GraphQL integration

Actual behavior

I'm getting the same unmapped fields error as mentioned in https://github.com/Netflix/dgs-framework/issues/1885 after migrating to Spring GraphQL integration.

Unmapped fields: {Query=[_service]}
Unmapped registrations: {}
Skipped types: []

Steps to reproduce

The only changes I made to migrate was switching the following dependencies:

-spring-boot-starter = { module = "org.springframework.boot:spring-boot-starter" }
+spring-boot-starter = { module = "org.springframework.boot:spring-boot-starter-webflux" }

-dgs-starter = { module = "com.netflix.graphql.dgs:graphql-dgs-webflux-starter"}
+dgs-starter = { module = "com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter"}

Spring Boot: 3.2.5 DGS: 8.5.8

Please let me know if I'm missing anything obvious, otherwise I'll try to reproduce it in a test repo.

srinivasankavitha commented 1 month ago

Hi - this is expected behavior since spring-graphql has schema inspection on by default. You can turn it off explicitly using this setting:


spring.graphql.schema.inspection.enabled=false

Hope this helps.

On Thu, May 9, 2024 at 2:01 AM Yang @.***> wrote:

Expected behavior

No issue after switching to Spring GraphQL integration Actual behavior

I'm getting the same unmapped fields error as mentioned in #1885 https://github.com/Netflix/dgs-framework/issues/1885 after migrating to Spring GraphQL integration.

Unmapped fields: {Query=[_service]} Unmapped registrations: {} Skipped types: []

Steps to reproduce

The only changes I made to migrate was switching the following dependencies:

-spring-boot-starter = { module = "org.springframework.boot:spring-boot-starter" }+spring-boot-starter = { module = "org.springframework.boot:spring-boot-starter-webflux" } -dgs-starter = { module = "com.netflix.graphql.dgs:graphql-dgs-webflux-starter"}+dgs-starter = { module = "com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter"}

Spring Boot: 3.2.5 DGS: 8.5.8

Please let me know if I'm missing anything obvious, otherwise I'll try to reproduce it in a test repo.

— Reply to this email directly, view it on GitHub https://github.com/Netflix/dgs-framework/issues/1906, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ5JPXMTBFSLZBBH6IGP5PTZBM3PVAVCNFSM6AAAAABHOOEPVGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4DOMRTGEZTKNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ychescale9 commented 1 month ago

Thanks, disabling schema inspection does fix the unmapped fields errors. However I'm still getting the following when trying to open graphiql:

This application has no configured error view, so you are seeing this as a fallback.

Fri May 10 09:58:05 AEST 2024
[4c2a6599-2] There was an unexpected error (type=Not Found, status=404).

Has anything changed with spring-graphql?

srinivasankavitha commented 1 month ago

No changes with the spring-graphql integration regarding this behavior. I'm not sure what this error is caused by either. You could try checking all the properties you are using to make sure nothing is misconfigured wrt graphql paths etc. : https://netflix.github.io/dgs/spring-graphql-integration/#dgs-configuration-with-spring-graphql

ychescale9 commented 1 month ago

I'm not setting any of these properties before migrating to Spring GraphQl integration. I'll try to reproduce it in a sample project.

ychescale9 commented 1 month ago

Looks like it's the url: