@twilio/flex-sdk
    Preparing search index...

    Interface RefetchQueriesOptions<TCache, TResult>

    Options object for the client.refetchQueries method.

    interface RefetchQueriesOptions<TCache extends ApolloCache, TResult> {
        include?: RefetchQueriesInclude;
        onQueryUpdated?: OnQueryUpdated<TResult> | null;
        optimistic?: boolean;
        updateCache?: (cache: TCache) => void;
    }

    Type Parameters

    • TCache extends ApolloCache
    • TResult
    Index

    Properties

    include?: RefetchQueriesInclude

    Optional array specifying queries to refetch. Each element can be either a query's string name or a DocumentNode object.

    Pass "active" as a shorthand to refetch all active queries, or "all" to refetch all active and inactive queries.

    Analogous to the options.refetchQueries array for mutations.

    onQueryUpdated?: OnQueryUpdated<TResult> | null

    Optional callback function that's called once for each ObservableQuery that's either affected by options.updateCache or listed in options.include (or both).

    If onQueryUpdated is not provided, the default implementation returns the result of calling observableQuery.refetch(). When onQueryUpdated is provided, it can dynamically decide whether (and how) each query should be refetched.

    Returning false from onQueryUpdated prevents the associated query from being refetched.

    optimistic?: boolean

    If true, the options.updateCache function is executed on a temporary optimistic layer of InMemoryCache, so its modifications can be discarded from the cache after observing which fields it invalidated.

    Defaults to false, meaning options.updateCache updates the cache in a lasting way.

    updateCache?: (cache: TCache) => void

    Optional function that updates cached fields to trigger refetches of queries that include those fields.