Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vejrj committed Dec 18, 2024
1 parent 4abcb9f commit 4b93dd8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/supermassive/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ This document describes the behaviour of hooks when they encounter errors.

#### `beforeOperationExecute`

Called before every operation

- **Thrown Error**: Stops execution and sets `data` to `null` and registers the error.
- **Returned Errors**: Registers the error and moves one.

Expand All @@ -23,16 +25,22 @@ This document describes the behaviour of hooks when they encounter errors.

#### `beforeFieldResolve`

Called before every field resolution

- **Thrown Error**: The field is not executed and is handled as if it has returned `null`.
- **Returned Errors**: Registers the error and moves one.

#### `afterFieldResolve`

Called after every field resolution.

- **Thrown Error**: The field is set to `null` and the error is registered.
- **Returned Errors**: Registers the error and moves one.

#### `afterFieldComplete`

Called when field value is completed

- **Thrown Error**: The field is set to `null` and the error is registered.
- **Returned Errors**: Registers the error and moves one.

Expand All @@ -41,12 +49,16 @@ This document describes the behaviour of hooks when they encounter errors.
- **Thrown Error**: Returns no data property, only errors.
- **Returned Errors**: Registers the error and moves one.

## Additional Hooks (Update 9.12)
## Additional Hooks

### `beforeFieldSubscribe`

Called before subscription event stream creation

- **Thrown or Returned Error**: Throws the error regardless of whether it is returned or thrown.

### `afterFieldSubscribe`

Called after subscription event stream creation

- **Thrown or Returned Error**: Throws the error regardless of whether it is returned or thrown.

0 comments on commit 4b93dd8

Please sign in to comment.