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

Subscription with fragments failing #27

Description

@TechnoChimp

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions