graphql / graphql/graphql-spec

Proposal: Support union scalar types

Open
#215 92 comments 296 reactions 0 assignees View on GitHub
👻 Needs Champion 💤 stale ? 💭 Strawman (RFC 0)
Dominant language
JavaScript
Stars
14.6k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

It makes sense often to have a field that could return, for example, an `Int` or a `String`. It would be convenient to be able to use a `resolveType`-like mechanism to determine how the value is serialized. This would be even more useful for custom scalars.

The specification currently says: "GraphQL Unions represent an object that could be one of a list of GraphQL Object types", which basically means that unions are the same as interfaces, but without any shared fields. Supporting unions of scalars would further differentiate unions from interfaces.

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.