graphql-kotlin icon indicating copy to clipboard operation
graphql-kotlin copied to clipboard

[client] Support `Extend Type`

Open todd-toast opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. Currently I'm working on implementing graphql in a couple of my applications. We have several schema files that get combined into one before compilation. This means we end up writing type query a lot. However since you cannot redefine a type, the graphql spec allows you to extend a type, which essentially adds other fields to the type. Currently this does not seem to be supported in the client code generation.

http://spec.graphql.org/October2021/#sec-Object-Extensions

Describe the solution you'd like It would be useful to support this extend type so that I don't have to define all my queries in one file.

Describe alternatives you've considered Currently the solution seems to be to put all queries and mutations in one file, in one type.

Additional context In the case that this is a bug, I also created a repository to reproduce the issue. https://github.com/todd-toast/kotlin-graphql-bug-repro. Currently the running the task createClient will fail, because the plugin is unable to find the query.

Thanks for your time!

todd-toast avatar Jul 20 '22 13:07 todd-toast

Hello 👋 Indeed, graphql-java loads type definitions and their extensions as two separate objects and we are only looking at the type definitions. Extensions (objects, interfaces, unions, etc) are currently not supported.

dariuszkuc avatar Jul 24 '22 04:07 dariuszkuc