Optional
batchOptional
batchDefault see https://github.com/graphql/dataloader#batch-scheduling. A function to schedule the later execution of a batch. The function is expected to call the provided callback in the immediate future.
Optional
cacheDefault true
. Set to false
to disable memoization caching, creating a
new Promise and new key in the batchLoadFn
for every load of the same
key. This is equivalent to setting cacheMap
to null
.
Optional
cacheDefault key => key
. Produces cache key for a given load key. Useful
when keys are objects and two objects should be considered equivalent.
Optional
cacheDefault new Map()
. Instance of Map
(or an object with a similar API)
to be used as cache. May be set to null
to disable caching.
Optional
maxDefault Infinity
. Limits the number of items that get passed in to the
batchLoadFn
. May be set to 1
to disable batching.
Optional
nameThe name given to this DataLoader
instance. Useful for APM tools.
Is null
if not set in the constructor.
Default
true
. Set tofalse
to disable batching, invokingbatchLoadFn
with a single load key. This is equivalent to settingmaxBatchSize
to1
.