Apollo Elements Guides API Blog

Hybrids: Mutation Factory

Exports

import { mutation } from '@apollo-elements/hybrids/factories/mutation';

mutation

Hybrids property descriptor factory for GraphQL Mutations. Implements the ApolloMutationElement interface.

Parameters

document

DocumentNode | TypedDocumentNode

The mutation document.

options

MutationHybridsFactoryOptions<D, V>

Options to configure the mutation.

Option Type Description
client
ApolloClient
ApolloClient instance use to make the call.
mutation
DocumentNode | TypedDocumentNode
A specific mutation document. See mutation.
variables
Variables<D, V> 
Operation variables. See variables.
optimisticResponse See optimisticResponse in ApolloMutationInterface
context
Record<string, unknown>
Context object passed through the link execution chain.
errorPolicy
ErrorPolicy
Error policy to use for the mutation. See errorPolicy
fetchPolicy
FetchPolicy
See fetchPolicy
refetchQueries See refetchQueries
awaitRefetchQueries
boolean
See awaitRefetchQueries
updater See updater Function used to update the client cache following the mutation.

Returns

Descriptor<ApolloMutationElement<D, V>>

Hybrids descriptor which mixes the ApolloMutationInterface in on connect