Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for leading vertical bar in union types #320

Merged
merged 3 commits into from
Jun 14, 2017
Merged
Changes from all 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
22 changes: 22 additions & 0 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down