-
|
I know this belongs in graphql-java-kickstart, since I am a user of it, but trying here as well since it is related to graphql-java as well. Is there a way to override the wiring/type resolution for a single type but keep the rest? I have a GraphQL interface Fruit which has subtypes Apple and Banana. There exists a corresponding java interface Fruit and java classes Apple and Banana . How do I introduce a new class only on the java side, lets say called Orange, which on the java side implements Fruit, but I want it to resolve to Banana on the GraphQL side (so I do not have to introduce another GraphQL type in the schema). I have tried using TypeResolvers for this. (See graphql-java-kickstart/graphql-java-tools#718). My problem stems from me wanting to extend an existing GraphQL interface with a new subtype, but this breaks backward compatibility for clients. I am considering other techniques:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
From graphql-java's perspective, each individual interface/union types has its own type resolver. So even if Kickstart isn't letting you customize it per-type, you can always transform the result by changing the |
Beta Was this translation helpful? Give feedback.
-
|
Assuming that kickstarts type resolves work like the base graphql java ones you would just do this in Java code I dont know how kickstart allows you to plugin in |
Beta Was this translation helpful? Give feedback.
From graphql-java's perspective, each individual interface/union types has its own type resolver. So even if Kickstart isn't letting you customize it per-type, you can always transform the result by changing the
GraphQLCodeRegistryand overriding the specific type resolver.