liaisev5.3.1
/Operation options

Reference

Operation options

This page lists every option a GraphQL operation takes. Look here when you write a new Operation and need an option’s exact type or default.

new Operation<TVariables, TData>(config) takes an OperationConfig. TVariables is the variables type and TData is the type of the response’s data (GraphQL).

OptionTypeDefaultWhat it does
operationstringrequiredThe GraphQL document, sent as query in the body.
middlewareMiddleware[]—Runs on every call to this operation, after client middleware and before call middleware.
headersHeadersInit—Sent with every call to this operation. Replaces the client’s value for the same header.
fetchOptionsFetchOptions—Options passed through to fetch on every call to this operation. Each field replaces the client’s.
dedupebooleanfalseA new call cancels the one still running (Drop stale calls with dedupe).
sharebooleanfalseCalls that would send the identical request share one network request (Sharing identical requests). Variables must match exactly, key order included. Can’t be combined with dedupe: createGraphQL throws if both are set.
schemaStandardSchemaV1—Checks the response’s data. The response type stays explicit (Validating responses).
timeoutnumber (ms)the client’s timeoutOne deadline for the whole call, retries included. Replaces the client’s, and 0 turns it off. Under share, it is also the shared request’s deadline.

An operation has no method, path, responseType or bodyAs. Every operation is a POST of { query, variables }, and the response is always read as JSON (Same as REST, and different).

Next: CallOptions lists what you can pass to one call.

esc