Skip to content

Commit 3725da4

Browse files
committed
Added resolver-returned value to the error object, plus further documentation on expected error fields (graphql#590)
1 parent c609a6d commit 3725da4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ The `graphqlHTTP` function accepts the following options:
118118
errors produced by fulfilling a GraphQL operation. If no function is
119119
provided, GraphQL's default spec-compliant [`formatError`][] function will be used.
120120

121+
Although the fields on the error provided to this function may vary (based on the error type), they will typically include:
122+
* **message:** the error message
123+
* **locations:** the location(s) in the Javascript code where the error ocurred
124+
* **path:** the path within the returned results where the error occurred (eg. in a schema violation error, the path to the part of the results that violated the schema)
125+
* **result:** the value which was returned by the resolver (if any)
126+
121127
- **`customParseFn`**: An optional function which will be used to create a document
122128
instead of the default `parse` from `graphql-js`.
123129

0 commit comments

Comments
 (0)