How to query the same object from different queries and make them same type? #1039
-
Hello,
Then I have two different queries, let's say
When I generate the sources, I end up with two kotlin classes, Is there a way to make I guess I could have done it by using interfaces in the schema, but I am not able to do that. Is there any other way, through querying? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Currently there is no way to force the client generator to re-use the classes. As output classes can have different selection sets we followed the simple rule of always recreating them. I think we probably could update the logic to re-use common output types and input types (as input types will ALWAYS be the same across the queries). |
Beta Was this translation helpful? Give feedback.
-
Kobby plugin generates DSL client that provides an ability to reuse generated classes |
Beta Was this translation helpful? Give feedback.
Currently there is no way to force the client generator to re-use the classes. As output classes can have different selection sets we followed the simple rule of always recreating them.
I think we probably could update the logic to re-use common output types and input types (as input types will ALWAYS be the same across the queries).