Additional metadata for an
Operation used to execute it.
OperationContext is found on context and gives exchanges additional metadata
and options used to execute the operation.
The context can often be changed on a per-operation basis, meaning, APIs on the Client or bindings can pass a partial context that alters these options for a single operation.
OperationContext is populated mostly from the initial options passed to the
Client at its
time of creation, but may also be modified by exchanges when an Operation is passed through
to the next exchange or when a result is returned.
A unique identity for GraphQL mutations.
This is an internal property set by the
Client to an identity of type OperationInstance.
OperationInstance is an identifier that's used to tell two mutation operations with identical
query documents and
variables apart from one another.
Additional cache tags for
The built-in cacheExchange in
@urql/core is a document cache that uses
mutation results to invalidate past, cached queries.
additionalTypenames array may be set to the list of custom typenames whenever a result may
__typename properties, e.g. when an empty array may be sent.
By providing a list of custom typenames you may "tag" a result as containing a certain type, which
helps the document cache associate mutations with queries when either don't actually contain a
__typename in the JSON result.
fetch function used to make API calls.
This is the fetch polyfill used by any fetch exchange to make an API request. By default, when this
option isn't set, any fetch exchange will attempt to use the globally available
to make a request instead.
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API for the Fetch API spec.
Additional options passed to the
fetch call on API requests.
The options in this object or an object returned by a callback function will be merged into the
RequestInit options passed to the
https://developer.mozilla.org/en-US/docs/Web/API/fetch for a description of this object.
fetchExchange to handle subscriptions.
When set to
true, subscriptions are allowed to be handled by the fetchExchange and will
be sent using a
fetch call as GraphQL over HTTP requests.
This may be enabled on fetchSubscriptions when your API supports the
multipart/mixed response protocols and is able to use them to
respond with subscription results.
Metadata that annotates an
Operation in development for the
This is metadata that is used by the
urql-devtools to get more information about
OperationResults and is filled in by exchanges across the codebase in development.
This data is not for production use and hence shouldn't be used or relied upon directly. In production, this may not be set by default exchanges.
Instructs fetch exchanges to use a GET request.
By default, GraphQL over HTTP requests are always sent as POST requests with a JSON body. However, sometimes it's preferable to send a GET request instead, for instance, for caching with or without persisted queries.
When set to
preferGetMethod instructs fetch exchanges to instead send a GET request
for query operations.
urql's built-in fetch exchanges will default to
'within-url-limit' and not send a GET request
when the resulting URL would be 2,048 characters or longer. This can be forced and circumvented by setting
this option to
The request and caching strategy instructing cache exchanges how to treat cached results.
The RequestPolicy instructing cache exchanges how to use and treat their cached results.
cache-first is set and used, which will use cache results, and only make an API request
on a cache miss.
A configuration flag indicating whether this operation may trigger "Suspense".
This configuration flag is reserved for
@urql/preact to activate or
deactivate support for Suspense, and is ignored in other bindings.
When activated here and on
Client.suspense it allows the bindings to "suspend" instead
of returning a loading state, which will stop updates in a querying component and instead cascade
to a higher suspense boundary for a loading state.
https://beta.reactjs.org/blog/2022/03/29/react-v18#new-suspense-features for more information on React Suspense.
url passed to the
fetch call on API requests.
https://developer.mozilla.org/en-US/docs/Web/API/fetch for a description of the
Generated using TypeDoc