spring-projects / spring-graphql

Spring Integration for GraphQL
https://spring.io/projects/spring-graphql
Apache License 2.0
1.5k stars 297 forks source link

SchemaMappingInspector should look in controller package if return type for a union is Object #960

Closed rstoyanchev closed 2 months ago

rstoyanchev commented 2 months ago

To resolve union types, the inspector tries to find matching Java classes in the same package as the return type of the controller method for the union. However, if there is no sealed type or marker interface to return, the return type is likely Object. As a fallback, we can also try in the package of the controller.