Skip to main content

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 NameDescription
storeExposes API used to communicate with the read model's persistent data storage.
paramsAn object that contains the request parameters as key-value pairs.
contextAn object that contains data and functions related to the current operation.

contextā€‹

The context argument is an object with the following fields:

Field NameDescription
jwtThe JSON Web Token attached to the request.
secretsManagerThe application's secrets manager.

This object can also contain additional fields added by middleware.