diff --git a/spec/Section 3 -- Type System.md b/spec/Section 3 -- Type System.md index 6941e20d8..7f974a90b 100644 --- a/spec/Section 3 -- Type System.md +++ b/spec/Section 3 -- Type System.md @@ -755,6 +755,28 @@ Union types have the potential to be invalid if incorrectly defined. Similarly, wrapping types may not be member types of a Union. 2. A Union type must define one or more unique member types. +#### Union type syntax + +Union types are defined by delimiting one or more types with a single vertical bar character `|`: + +```graphql +union SearchResult = Photo | Person +``` + +You may also use a leading vertical bar: + +```graphql +union SearchResult = + | Photo + | Person +``` + +Trailing delimiters are not supported: + +```!graphql +union SearchResult = Photo | Person | +``` + ### Enums GraphQL Enums are a variant on the Scalar type, which represents one of a