Skip to content

Commit

Permalink
Add example of variable coercion failure (#289)
Browse files Browse the repository at this point in the history
Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Benedikt Franke <benedikt@franke.tech>
  • Loading branch information
3 people authored Aug 5, 2024
1 parent d8a8cd4 commit 511b735
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/GraphQLOverHTTP.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,18 @@ If
raises a _GraphQL request error_, the server SHOULD NOT execute the request and
SHOULD return a status code of `200` (Okay).

For example the well-formed GraphQL-over-HTTP request:

```json
{
"query": "query getItemName($id: ID!) { item(id: $id) { id name } }",
"variables": { "id": null }
}
```

would fail variable coercion as the value for `id` would fail to satisfy the
query document's expectation that `id` is non-null.

##### Field errors encountered during execution

If the operation is executed and no _GraphQL request error_ is raised then the
Expand Down

0 comments on commit 511b735

Please sign in to comment.