Skip to content

Commit

Permalink
conciser validation
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Mar 27, 2024
1 parent 7cad383 commit ac9fdbc
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions spec/Section 5 -- Validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -579,35 +579,19 @@ fragment conflictingDifferingResponses on Pet {

Fragment spread arguments can also cause fields to fail to merge.

While the following is valid:

```graphql example
fragment commandFragment($command: DogCommand!) on Dog {
doesKnowCommand(dogCommand: $command)
}

fragment potentiallyConflictingArguments(
$commandOne: DogCommand!
$commandTwo: DogCommand!
) on Dog {
...commandFragment(command: $commandOne)
...commandFragment(command: $commandTwo)
}

fragment safeFragmentArguments on Dog {
...potentiallyConflictingArguments(commandOne: SIT, commandTwo: SIT)
}
```

it is only valid because `safeFragmentArguments` uses
`potentiallyConflictingArguments` with the same value for the fragment-defined
variables `commandOne` and `commandTwo`. Therefore `commandFragment` resolves
`doesKnowCommand`'s `dogCommand` argument value to `SIT` in both cases.

However, by changing the fragment spread argument values:

```graphql counter-example
fragment conflictingFragmentArguments on Dog {
...potentiallyConflictingArguments(commandOne: SIT, commandTwo: DOWN)
}
```
Expand Down

0 comments on commit ac9fdbc

Please sign in to comment.