Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Subscription with fragments failing #27

Open
TechnoChimp opened this issue Apr 20, 2022 · 0 comments
Open

Subscription with fragments failing #27

TechnoChimp opened this issue Apr 20, 2022 · 0 comments

Comments

@TechnoChimp
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant