Skip to content

Commit f325be8

Browse files
author
scf4
committed
added options to docs
1 parent c614421 commit f325be8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,14 @@ to an error class created and returned by `createError` documented below. Error
8888
initialized with a custom `time_thrown` ISODate (default is current ISODate) and `data` object (which will be merged with data specified through `createError`, if it exists).
8989

9090

91-
### createError(name, {message: String, [data: Object]}): ApolloError
91+
### createError(name, {message: String, [data: Object, options: Object]}): ApolloError
9292

93-
Creates and returns an error class with the given `name` and `message`, optionally initialized with the given `data`. `data` passed to `createError` will later be merged with any data passed to the constructor.
93+
Creates and returns an error class with the given `name` and `message`, optionally initialized with the given `data` and `options`. `data` passed to `createError` will later be merged with any data passed to the constructor.
94+
95+
#### Options (default):
96+
97+
- `showPath` *(false)*: Preserve the GraphQLError `path` data.
98+
- `showLocations` *(false)*: Preserve the GraphQLError `path` data.
9499

95100
### formatError (error, strict = false): ApolloError|Error|null
96101
If the error is a known ApolloError, returns the serialized form of said error.

0 commit comments

Comments
 (0)