Is it possible to generate same classes for the same type of inline fragment that is under different unions?
for example,
query {
x{
_typename
...on A{
...fragment
}
}
and
query {
y{
__typename
...on A{
...fragment
}
}
Where x and y are different unions including A.
The reference to A for both queries will generate different classes. How to write these queries in such a way that it generates the same class like ...fragment would?
Try to use fragmnets like this
query {
y{
__typename
...fragment
}
It will generate separete mixins and you'll be able to refer to them as obj is FragmentMixin
Try to use fragmnets like this
query { y{ __typename ...fragment }It will generate separete mixins and you'll be able to refer to them as
obj is FragmentMixin
Can I do this for inline fragments? How will I write such a fragment when the fragment x on Y part of the code can't be written without knowing what Y is beforehand?