liaisev5.3.1
/CallOptions

Reference

CallOptions

This page lists the options you can pass to a single call, as its second argument: api.getUser(params, options). Look here when one call needs its own headers, middleware, signal or deadline.

GraphQL calls take the same options. paginate takes them too, and applies them to every page. poll and pollUntil apply them to every request, except signal, which stops polling instead (poll() and pollUntil() options).

OptionTypeDefaultWhat it does
middlewareMiddleware[]—Runs after the client’s and the endpoint’s middleware. Under share, what it changes in the request is part of what is compared.
skipMiddlewareMiddleware[]—Middleware to leave out of this call, matched by reference (Skipping a middleware for one call).
headersHeadersInit—Replaces the client’s and the endpoint’s value for the same header. Under share they are part of what is compared, so identical per-call headers share.
fetchOptionsFetchOptions—Options passed through to fetch for this call. Each field replaces the client’s and the endpoint’s. Under share they are part of what is compared.
signalAbortSignal—Cancels the call, which ends with kind: 'abort', even while a middleware is stuck (Cancel with a signal). Under share, it releases only this caller.
timeoutnumber (ms)the endpoint’s timeout, else the client’sReplaces the endpoint’s and the client’s deadline for this call. 0 turns it off. Under share, it bounds only this caller’s wait (Share key and refcount).

Every timeout, on the client, an endpoint, an operation or a call, is read the same way:

  • A fractional value is rounded down to whole milliseconds, with a minimum of 1 ms.
  • A value above the timer limit of 2³¹ − 1 ms is capped there.
  • Zero, a negative number or NaN means no deadline.

Next: getHeaders() shows the headers an endpoint sends from its configuration.

esc