tal / graphql-type-issue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL issue with two types of same structure

For the following type definitions:

type One {
  id: String!
  other: String
}

type Two {
  id: String!
  other: String
}

union All = One | Two

The type will always come out as __typename: "One"

{
  __typename: 'Two',
  id: 'twoone',
  other: 'other',
}

This happens regardless of what __typename is set to or any typescript types.

About


Languages

Language:TypeScript 80.6%Language:JavaScript 15.3%Language:HTML 3.1%Language:Shell 1.1%