Closed SharbelOkzan closed 7 months ago
👋 @SharbelOkzan Thank you for raising an issue. I will investigate the issue and get back to you as soon as possible. Please make sure you have provided enough context.
This library is created and maintained by me, @budde377. Please consider supporting my work and ensure our survival by donating here.
Thanks for raising this @SharbelOkzan. This is by design the subclasses are not optimised based on the type they are on or the field they select. If you want a single type for each of these, you can define a fragment
fragment Prize on Prize {
amount
currency
}
And then spread this in the sub selections
first_price { ... Prize }
...
This will generate a common dart type for each prize.
That makes sense.
And thanks for the quick response! Truly appreciate that. Closing as completed.
A type in my schema looks like this
And the query is
The generated Dart class has the following fields:
While what's desired is
In other words, the generated classes count should be the same as the types count in the schema.
Query$HomePageTournaments$tournaments$first_prize
andQuery$HomePageTournaments$tournaments$second_prize
are the same thing.Am I missing something or this is by design? Thanks in advance :)