Closed mxstbr closed 5 years ago
@evenchange4 are you going to work on this? I can give it a shot otherwise
Verified in my project. It should be fixed with version v1.4.2
now. Thanks @FezVrasta !
@evenchange4 I am using 1.4.2 and this is still the issue. Fragments are duplicated and the server rejects it. I've checked the test you added for this and I don't think it's sufficient. Apparently, something else is happening when fragments are nested over several documents. I've verified that with repeated fragments over a single documents the deduplication indeed works.
query {
order {
items {
...FItemDetail
subitems {
...FItemDetail
}
}
}
}
fragment FItemDetail on Item {
price {
...FPrice
}
}
fragment FPrice on PriceConverted {
value
currency
}
I have a query that uses a fragment directly, and another fragment that uses the same fragment in a nested manner:
With a
communityParticipantInfo
fragment that looks like this:As you can see, the
userInfoFragment
is repeated twice. Usinggraphql-tag
at runtime correctly deduplicates that fragment and everything works perfectly.Unfortunately,
graphql.macro
does not deduplicate the fragment and my server thusly throws an error saying "Duplicate fragment" and rejects the query entirely.