@twilio/flex-sdk
    Preparing search index...
    • This resolves a single mutation according to the options specified and returns a Promise which is either resolved with the resulting data or rejected with an error. In some cases both data and errors might be undefined, for example when errorPolicy is set to 'ignore'.

      It takes options as an object with the following keys and values:

      Type Parameters

      • TData
      • TVariables extends OperationVariables
      • _INFERENCE_ONLY_DO_NOT_SPECIFY extends "inferred"
      • TErrorPolicy extends ErrorPolicy | undefined = undefined

      Parameters

      • options: {
            awaitRefetchQueries?: boolean;
            context?: DefaultContext;
            errorPolicy?: ErrorPolicy;
            fetchPolicy?: MutationFetchPolicy;
            keepRootFields?: boolean;
            mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
            onQueryUpdated?: OnQueryUpdated<any>;
            optimisticResponse?:
                | NoInfer<TData>
                | (
                    (
                        vars: TVariables,
                        __namedParameters: { IGNORE: IgnoreModifier },
                    ) => IgnoreModifier | NoInfer<TData>
                );
            refetchQueries?:
                | InternalRefetchQueriesInclude
                | (
                    (
                        result: NormalizedExecutionResult<TData>,
                    ) => InternalRefetchQueriesInclude
                );
            update?: MutationUpdaterFunction<TData, TVariables, ApolloCache>;
            updateQueries?: MutationQueryReducersMap<TData>;
        } & VariablesOption<NoInfer<TVariables>> & { errorPolicy?: TErrorPolicy }
        • OptionalawaitRefetchQueries?: boolean

          If true, makes sure all queries included in refetchQueries are completed before the mutation is considered complete.

          The default value is false (queries are refetched asynchronously).

          1. Operation options
        • Optionalcontext?: DefaultContext

          If you're using Apollo Link, this object is the initial value of the context object that's passed along your link chain.

          1. Networking options
        • OptionalerrorPolicy?: ErrorPolicy

          Specifies how the mutation handles a response that returns both GraphQL errors and partial results.

          For details, see GraphQL error policies.

          The default value is none, meaning that the mutation result includes error details but not partial results.

          1. Operation options
        • OptionalfetchPolicy?: MutationFetchPolicy

          Provide no-cache if the mutation's result should not be written to the Apollo Client cache.

          The default value is network-only (which means the result is written to the cache).

          Unlike queries, mutations do not support fetch policies besides network-only and no-cache.

          1. Caching options
        • OptionalkeepRootFields?: boolean

          To avoid retaining sensitive information from mutation root field arguments, Apollo Client v3.4+ automatically clears any ROOT_MUTATION fields from the cache after each mutation finishes. If you need this information to remain in the cache, you can prevent the removal by passing keepRootFields: true to the mutation. ROOT_MUTATION result data are also passed to the mutation update function, so we recommend obtaining the results that way, rather than using this option, if possible.

        • mutation: DocumentNode | TypedDocumentNode<TData, TVariables>

          A GraphQL document, often created with gql from the graphql-tag package, that contains a single mutation inside of it.

          1. Operation options
        • OptionalonQueryUpdated?: OnQueryUpdated<any>

          Optional callback for intercepting queries whose cache data has been updated by the mutation, as well as any queries specified in the refetchQueries: [...] list passed to client.mutate.

          Returning a Promise from onQueryUpdated will cause the final mutation Promise to await the returned Promise. Returning false causes the query to be ignored.

          1. Operation options
        • OptionaloptimisticResponse?:
              | NoInfer<TData>
              | (
                  (
                      vars: TVariables,
                      __namedParameters: { IGNORE: IgnoreModifier },
                  ) => IgnoreModifier | NoInfer<TData>
              )

          By providing either an object or a callback function that, when invoked after a mutation, allows you to return optimistic data and optionally skip updates via the IGNORE sentinel object, Apollo Client caches this temporary (and potentially incorrect) response until the mutation completes, enabling more responsive UI updates.

          For more information, see Optimistic mutation results.

          1. Caching options
        • OptionalrefetchQueries?:
              | InternalRefetchQueriesInclude
              | (
                  (
                      result: NormalizedExecutionResult<TData>,
                  ) => InternalRefetchQueriesInclude
              )

          An array (or a function that returns an array) that specifies which queries you want to refetch after the mutation occurs.

          Each array value can be either:

          • An object containing the query to execute, along with any variables

          • A string indicating the operation name of the query to refetch

          1. Operation options
        • Optionalupdate?: MutationUpdaterFunction<TData, TVariables, ApolloCache>

          A function used to update the Apollo Client cache after the mutation completes.

          For more information, see Updating the cache after a mutation.

          1. Caching options
        • OptionalupdateQueries?: MutationQueryReducersMap<TData>

          A MutationQueryReducersMap, which is map from query names to mutation query reducers. Briefly, this map defines how to incorporate the results of the mutation into the results of queries that are currently being watched by your application.

      Returns Promise<MutateResult<TData, TErrorPolicy>>

    • Type Parameters

      • TData
      • TVariables extends OperationVariables = OperationVariables
      • TCache extends ApolloCache = ApolloCache
      • TErrorPolicy extends ErrorPolicy | undefined = undefined

      Parameters

      • options: {
            awaitRefetchQueries?: boolean;
            context?: DefaultContext;
            errorPolicy?: ErrorPolicy;
            fetchPolicy?: MutationFetchPolicy;
            keepRootFields?: boolean;
            mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
            onQueryUpdated?: OnQueryUpdated<any>;
            optimisticResponse?:
                | NoInfer<TData>
                | (
                    (
                        vars: TVariables,
                        __namedParameters: { IGNORE: IgnoreModifier },
                    ) => IgnoreModifier | NoInfer<TData>
                );
            refetchQueries?:
                | InternalRefetchQueriesInclude
                | (
                    (
                        result: NormalizedExecutionResult<TData>,
                    ) => InternalRefetchQueriesInclude
                );
            update?: MutationUpdaterFunction<TData, TVariables, TCache>;
            updateQueries?: MutationQueryReducersMap<TData>;
        } & VariablesOption<NoInfer<TVariables>> & (
            TErrorPolicy extends undefined ? {} : { errorPolicy: TErrorPolicy }
        )
        • OptionalawaitRefetchQueries?: boolean

          If true, makes sure all queries included in refetchQueries are completed before the mutation is considered complete.

          The default value is false (queries are refetched asynchronously).

          1. Operation options
        • Optionalcontext?: DefaultContext

          If you're using Apollo Link, this object is the initial value of the context object that's passed along your link chain.

          1. Networking options
        • OptionalerrorPolicy?: ErrorPolicy

          Specifies how the mutation handles a response that returns both GraphQL errors and partial results.

          For details, see GraphQL error policies.

          The default value is none, meaning that the mutation result includes error details but not partial results.

          1. Operation options
        • OptionalfetchPolicy?: MutationFetchPolicy

          Provide no-cache if the mutation's result should not be written to the Apollo Client cache.

          The default value is network-only (which means the result is written to the cache).

          Unlike queries, mutations do not support fetch policies besides network-only and no-cache.

          1. Caching options
        • OptionalkeepRootFields?: boolean

          To avoid retaining sensitive information from mutation root field arguments, Apollo Client v3.4+ automatically clears any ROOT_MUTATION fields from the cache after each mutation finishes. If you need this information to remain in the cache, you can prevent the removal by passing keepRootFields: true to the mutation. ROOT_MUTATION result data are also passed to the mutation update function, so we recommend obtaining the results that way, rather than using this option, if possible.

        • mutation: DocumentNode | TypedDocumentNode<TData, TVariables>

          A GraphQL document, often created with gql from the graphql-tag package, that contains a single mutation inside of it.

          1. Operation options
        • OptionalonQueryUpdated?: OnQueryUpdated<any>

          Optional callback for intercepting queries whose cache data has been updated by the mutation, as well as any queries specified in the refetchQueries: [...] list passed to client.mutate.

          Returning a Promise from onQueryUpdated will cause the final mutation Promise to await the returned Promise. Returning false causes the query to be ignored.

          1. Operation options
        • OptionaloptimisticResponse?:
              | NoInfer<TData>
              | (
                  (
                      vars: TVariables,
                      __namedParameters: { IGNORE: IgnoreModifier },
                  ) => IgnoreModifier | NoInfer<TData>
              )

          By providing either an object or a callback function that, when invoked after a mutation, allows you to return optimistic data and optionally skip updates via the IGNORE sentinel object, Apollo Client caches this temporary (and potentially incorrect) response until the mutation completes, enabling more responsive UI updates.

          For more information, see Optimistic mutation results.

          1. Caching options
        • OptionalrefetchQueries?:
              | InternalRefetchQueriesInclude
              | (
                  (
                      result: NormalizedExecutionResult<TData>,
                  ) => InternalRefetchQueriesInclude
              )

          An array (or a function that returns an array) that specifies which queries you want to refetch after the mutation occurs.

          Each array value can be either:

          • An object containing the query to execute, along with any variables

          • A string indicating the operation name of the query to refetch

          1. Operation options
        • Optionalupdate?: MutationUpdaterFunction<TData, TVariables, TCache>

          A function used to update the Apollo Client cache after the mutation completes.

          For more information, see Updating the cache after a mutation.

          1. Caching options
        • OptionalupdateQueries?: MutationQueryReducersMap<TData>

          A MutationQueryReducersMap, which is map from query names to mutation query reducers. Briefly, this map defines how to incorporate the results of the mutation into the results of queries that are currently being watched by your application.

      Returns Promise<MutateResult<TData, TErrorPolicy>>

      Avoid manually specifying generics on client.mutate. Instead, rely on TypeScript's type inference along with a correctly typed TypedDocumentNode to get accurate types for your mutation results.

      This resolves a single mutation according to the options specified and returns a Promise which is either resolved with the resulting data or rejected with an error. In some cases both data and errors might be undefined, for example when errorPolicy is set to 'ignore'.

      It takes options as an object with the following keys and values: