graphql-relay-js icon indicating copy to clipboard operation
graphql-relay-js copied to clipboard

Can I return a union type on `outputFields`?

Open noghartt opened this issue 2 years ago • 0 comments

Is there a way that I can return a union type on outputFields? I want to do something like it:

mutation userRegister($input: UserRegisterInput!) {
  userRegister(input: $input) {
    ... on UserRegisterResultSuccess {
      user {
        id
      }
    }
    ... on Error {
      message
    }
  }
}

I would like to know if there's a way to do it on outputFields of a mutation.

noghartt avatar Dec 08 '21 23:12 noghartt