Skip to content

Commit d6a0615

Browse files
benjieeddeee888
andauthored
Crisp up the wording around error handling clients (#10326)
* Crisp up the wording around error handling clients * Update packages/plugins/typescript/operations/src/config.ts Co-authored-by: Eddy Nguyen <github@eddeee888.me> * Add link to graphql-toe --------- Co-authored-by: Eddy Nguyen <github@eddeee888.me>
1 parent b9a0af8 commit d6a0615

File tree

1 file changed

+7
-1
lines changed
  • packages/plugins/typescript/operations/src

1 file changed

+7
-1
lines changed

packages/plugins/typescript/operations/src/config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,14 @@ export interface TypeScriptDocumentsPluginConfig extends RawDocumentsConfig {
297297
* @description Options related to handling nullability
298298
* @exampleMarkdown
299299
* ## `errorHandlingClient`
300+
* An error handling client is a client which prevents the user from reading a `null` used as a placeholder for an error in a GraphQL response.
301+
* The client may do so by throwing when an errored field is accessed (as is the case for [`graphql-toe`](https://github.com/graphile/graphql-toe)),
302+
* or when a fragment containing an error is read (as is the case for Relay's `@throwOnFieldError` directive),
303+
* or by preventing any data from being read if an error occurred (as with Apollo Client's `errorPolicy: "none"`).
304+
*
300305
* When using error handling clients, a semantic non-nullable field can never be `null`.
301-
* If a field is read and its value is `null`, there must be a respective error. The error handling client will throw in this case, so the `null` value is never read.
306+
* If a semantic non-nullable field's value in the response is `null`, there must be a respective error.
307+
* The error handling client will throw in this case, so the `null` value is never read.
302308
*
303309
* To enable this option, install `graphql-sock` peer dependency:
304310
*

0 commit comments

Comments
 (0)