Hello !
I have a question on how I could improve the classes generated by apollo from our schema (cf image).
_13_5 and _6_5 objects are exactly the same.
In my query I first had:
images {
_13_5 {
alt
title
files {
width
height
url
}
}
_6_5 {
alt
title
files {
width
height
url
}
}
}
I was happy with it BUT I have a problem with “files”. In our schema both files are of the same type [ImageFile]
but in the generated class I have List<File>
for _13_5 and List<File1>
for _6_5 and it complicates the transformation I do later in the code because I have to duplicate it for File and File1 objects.
I tried to create a fragment:
fragment imageFragment on Image {
alt
title
files {
width
height
url
}
}
[...]
images {
_13_5 {
...imageFragment
}
_6_5 {
...imageFragment
}
}
And it did actually merge both objects into one List<File>
for _13_5 and _6_5 so I just have one object transformation to implement BUT imageFragment is a subtype of GraphqlFragment
and I don’t have apollo depedencies in the module where I do my transformation and I would like not to add it…but I don’t have access to the fragment values
So I’m wondering if I could do something to not create a new fragment but to say to apollo that both files are of the same type ?