Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.66 KB

resolver.md

File metadata and controls

42 lines (30 loc) · 1.66 KB
id title description
resolver
Resolver
A resolver is the part of a Read Model that handles data requests.

:::info 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.