Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__typename on unions not working #269

Open
amiralies opened this issue Sep 7, 2021 · 1 comment
Open

__typename on unions not working #269

amiralies opened this issue Sep 7, 2021 · 1 comment

Comments

@amiralies
Copy link

testing master with a sdl schema,
looks like i can get __typename on unions.

schema {
  query: Queries
}

type Queries {
  getUsers: [User!]!
}

type User {
  id: String!
  role: Role!
}

union Role = Admin | Member

type Admin {
  y: Int!
}

type Member {
  x: Int!
}

query:

query { 
  getUsers {
    role {
      ... on Member {
        __typename
        x
      }

      ... on Admin {
        y
      }
    }
  }
}
@jfrolich
Copy link
Collaborator

jfrolich commented Sep 7, 2021

Ah hmm that is probably some implicit type that I forgot to include, thanks for catching it!

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

No branches or pull requests

2 participants