Skip to content

Commit c4d0b50

Browse files
committed
Add more examples
1 parent 0c9830e commit c4d0b50

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

spec/Section 5 -- Validation.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ type Query {
4242
}
4343

4444
type Mutation {
45-
addPet(pet: PetInput): Pet
45+
addPet(pet: PetInput!): Pet
46+
addPets(pet: [PetInput!]!): [Pet]
4647
}
4748

4849
enum DogCommand {
@@ -1351,6 +1352,12 @@ query goodComplexDefaultValue($search: FindDogInput = { name: "Fido" }) {
13511352
name
13521353
}
13531354
}
1355+
1356+
mutation addPet($pet: PetInput! = { cat: { name: "Brontie" } }) {
1357+
addPet(pet: $pet) {
1358+
name
1359+
}
1360+
}
13541361
```
13551362

13561363
Non-coercible values (such as a String into an Int) are invalid. The following
@@ -1366,6 +1373,24 @@ query badComplexValue {
13661373
name
13671374
}
13681375
}
1376+
1377+
mutation oneOfWithNoFields {
1378+
addPet(pet: {}) {
1379+
name
1380+
}
1381+
}
1382+
1383+
mutation oneOfWithTwoFields($dog: DogInput) {
1384+
addPet(pet: { cat: { name: "Brontie" }, dog: $dog }) {
1385+
name
1386+
}
1387+
}
1388+
1389+
mutation listOfOneOfWithNullableVariable($dog: DogInput) {
1390+
addPets(pets: [{ dog: $dog }]) {
1391+
name
1392+
}
1393+
}
13691394
```
13701395

13711396
### Input Object Field Names

0 commit comments

Comments
 (0)