graphql / graphql/graphql-relay-js

Can I return a union type on `outputFields`?

Open
#367 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
177
Avg merge
10m
Merged PRs (30d)
1

Description

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

```graphql
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.