federation-subscription-tools
federation-subscription-tools copied to clipboard
Subscription with fragments failing
Given a subscription with the shape:
subscription($myId: ID!) {
myQuery(id: $myId) {
id
fieldA {
filedB {
... on UnionTypeA {
fieldC
fieldD
}
... on UnionTypeB {
fieldC
fieldE
}
}
}
}
}
My subscription gateway is generating errors from the backend:
[GraphQL error]: Cannot query field "fieldC" on type "MyUnion". Did you mean to use an inline fragment on "UnionTypeA" or "UnionTypeB"?
[GraphQL error]: Cannot query field "fieldD" on type "MyUnion". Did you mean to use an inline fragment on "UnionTypeA" or "UnionTypeB"?
[GraphQL error]: Cannot query field "fieldE" on type "MyUnion". Did you mean to use an inline fragment on "UnionTypeA" or "UnionTypeB"?
Additionally, logging the selection being returned from the buildNonPayloadSelections
method is giving the following shape:
id fieldA { fieldB { fieldC } } fieldA { fieldB { fieldD } } fieldA { fieldB { fieldE } }
It seems the generated selection has dropped the fragments?