Skip to content

Commit

Permalink
Improve union type docs
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed May 10, 2024
1 parent dc3125d commit 21b1857
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions docs/6/the-basics/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,19 @@ Read more about them in the [GraphQL Reference](https://graphql.org/learn/schema
## Union

A Union is an abstract type that simply enumerates other Object Types.
They are similar to interfaces in that they can return different types, but they can not
have fields defined.
They are similar to interfaces in that they can return different types, but do not prescribe any common fields.

```graphql
union Person = User | Employee

type User {
id: ID!
email: String!
}

type Employee {
employeeId: ID!
id: ID!
department: Department!
}
```

Expand Down
7 changes: 4 additions & 3 deletions docs/master/the-basics/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,19 @@ Read more about them in the [GraphQL Reference](https://graphql.org/learn/schema
## Union

A Union is an abstract type that simply enumerates other Object Types.
They are similar to interfaces in that they can return different types, but they can not
have fields defined.
They are similar to interfaces in that they can return different types, but do not prescribe any common fields.

```graphql
union Person = User | Employee

type User {
id: ID!
email: String!
}

type Employee {
employeeId: ID!
id: ID!
department: Department!
}
```

Expand Down

0 comments on commit 21b1857

Please sign in to comment.