Resolver
TypeScript Support
Read model resolvers are grouped into a Resolvers container object that has an associated TypeScript type:
- Type Name -
ReadModelResolvers - Package -
@resolve-js/core
A read model resolver function has the following structure:
async (store, params, context) => {
...
return resultingData
}
A resolver implementation receives the following arguments:
| Argument Name | Description |
|---|---|
| store | Exposes API used to communicate with the read model's persistent data storage. |
| params | An object that contains the request parameters as key-value pairs. |
| context | An object that contains data and functions related to the current operation. |
contextā
The context argument is an object with the following fields:
| Field Name | Description |
|---|---|
| jwt | The JSON Web Token attached to the request. |
| secretsManager | The application's secrets manager. |
This object can also contain additional fields added by middleware.