Skip to content

Commit

Permalink
Adds example
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalSenn committed Jan 2, 2025
1 parent e0c56aa commit 389195a
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion spec/Section 4 -- Composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -2889,7 +2889,7 @@ different source schemas will result in a schema composition error.

**Examples**

In the the following example both source schemas have an input field `field1`
In the the following example both source schemas have an input field `genre`
with the same default value. This is valid:

```graphql example
Expand All @@ -2915,6 +2915,32 @@ enum Genre {
}
```

If only one of the source schemas defines a default value for a given input field,
the composition is still valid:

```graphql example
# Schema A

input BookFilter {
genre: Genre
}

enum Genre {
FANTASY
SCIENCE_FICTION
}

# Schema B
input BookFilter {
genre: Genre = FANTASY
}

enum Genre {
FANTASY
SCIENCE_FICTION
}
```

In the following counter-example both source schemas define an input field
`minPageCount` with different default values. This is invalid:

Expand Down

0 comments on commit 389195a

Please sign in to comment.