Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,24 @@ 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to You may also use a leading vertical bar: to be consistent with the opening clause.


```graphql
union SearchResult =
| Photo
| Person
```

Note Trailing vertical bars are not supported.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would update this to say "Trailing delimiters are not supported:" followed by an (invalid) example. You can "```!graphql" to designate an invalid example.


### Enums

GraphQL Enums are a variant on the Scalar type, which represents one of a
Expand Down