Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Added resolver-returned value to the error object, plus further docum… #612

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ The `graphqlHTTP` function accepts the following options:
errors produced by fulfilling a GraphQL operation. If no function is
provided, GraphQL's default spec-compliant [`formatError`][] function will be used.

Although the fields on the error provided to this function may vary (based on the error type), they will typically include:

- **message:** the error message
- **locations:** the location(s) in the Javascript code where the error ocurred
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be locations inside query/SDL string not inside JS code

- **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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by schema violation error?

- **result:** the value which was returned by the resolver (if any)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@machineghost Don't think we have it on any of errors?


- **`customParseFn`**: An optional function which will be used to create a document
instead of the default `parse` from `graphql-js`.

Expand Down