MutationConfig
Type MutationConfig<TMutationConfig: MutationParameters>
​
- An object with the following fields:
cacheConfig
: [Optional]CacheConfig
mutation
:GraphQLTaggedNode
. A mutation specified using a GraphQL literalonError
: [Optional](Error) => void
. An optional callback executed if the mutation results in an error.onCompleted
: [Optional]($ElementType<TMutationConfig, 'response'>) => void
. An optional callback that is executed when the mutation completes.onUnsubscribe
: [Optional]() => void
. An optional callback that is executed when the mutation the mutation is unsubscribed, which occurs when the returnedDisposable
is disposed.optimisticResponse
: [Optional] An object whose type matches the raw response type of the mutation. Make sure you decorate your mutation with@raw_response_type
if you are using this field.optimisticUpdater
: [Optional]SelectorStoreUpdater
. A callback that is executed whencommitMutation
is called, after theoptimisticResponse
has been normalized into the store.updater
: [Optional]SelectorStoreUpdater
. A callback that is executed when a payload is received, after the payload has been written into the store.uploadables
: [Optional]UploadableMap
. An optional uploadable map.variables
:$ElementType<TMutationConfig, 'variables'>
. The variables to pass to the mutation.
Type CacheConfig
​
- An object with the following fields:
force
: [Optional] A boolean. If true, causes a query to be issued unconditionally, regardless of the state of any configured response cache.poll
: [Optional] A number. Causes a query to live-update by polling at the specified interval, in milliseconds. (This value will be passed tosetTimeout
).liveConfigId
: [Optional] A string. Causes a query to live-update by calling GraphQLLiveQuery; it represents a configuration of gateway when doing live query.metadata
: [Optional] An object. User-supplied metadata.transactionId
: [Optional] A string. A user-supplied value, intended for use as a unique id for a given instance of executing an operation.
Type SelectorStoreUpdater
​
- A function with signature
(store: RecordSourceSelectorProxy, data) => void
- This interface allows you to imperatively write and read data directly to and from the Relay store. This means that you have full control over how to update the store in response to the subscription payload: you can create entirely new records, or update or delete existing ones. The full API for reading and writing to the Relay store is available here.
Type UploadableMap
​
Type MutationParameters
​
- An object with the following fields:
response
: An objectvariables
: An objectrawResponse
: An optional object