CacheByOptions interface

Options expected by @cacheBy() decorator factory

Signature:

export interface CacheByOptions 

Properties

Property

Modifiers

Type

Description

fieldsArg?

number

(Optional) Zero-index based position of fields argument in a method arguments, which are passed at runtime. Fields argument are usually passed from a client to specify a query map to be extracted and returned from a service method. For example, fields map can be built from an incoming GraphQL request using fieldsMap() function from graphql-fields-list package.

Usually pg-based @imqueue services, which utilize @imqueue/pg-sequelize package passing fields as a second argument to service methods, so if this option is omitted, it will try to check for the second passed argument. If you need to explicitly disable it, pass -1.

ttl?

number

(Optional) Time to live for cached values. If not specified - default is used. Default is equivalent of 24 hours. Must be specified in milliseconds.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.