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

    Interface WriteFragmentOptions<TData, TVariables>

    interface WriteFragmentOptions<TData, TVariables extends OperationVariables> {
        broadcast?: boolean;
        data: TData;
        fragment: DocumentNode | TypedDocumentNode<TData, TVariables>;
        fragmentName?: string;
        from?: FromOptionValue<TData>;
        id?: string;
        overwrite?: boolean;
        variables?: TVariables;
    }

    Type Parameters

    • TData
    • TVariables extends OperationVariables

    Hierarchy (View Summary)

    Index

    Properties

    broadcast?: boolean

    Whether to notify query watchers.

    true
    
    data: TData

    The data to write to the store.

    A GraphQL document created using the gql template string tag from graphql-tag with one or more fragments which will be used to determine the shape of data to read. If you provide more than one fragment in this document then you must also specify fragmentName to specify which fragment is the root fragment.

    fragmentName?: string

    The name of the fragment in your GraphQL document to be used. If you do not provide a fragmentName and there is only one fragment in your fragment document then that fragment will be used.

    from?: FromOptionValue<TData>

    An object containing a __typename and primary key fields (such as id) identifying the entity object from which the fragment will be retrieved, or a { __ref: "..." } reference, or a string ID (uncommon).

    from is given precedence over id when both are provided.

    id?: string

    The root id to be used. This id should take the same form as the value returned by the cache.identify function. If a value with your id does not exist in the store, null will be returned.

    overwrite?: boolean

    When true, ignore existing field data rather than merging it with incoming data.

    false
    
    variables?: TVariables

    Any variables that your GraphQL fragments depend on.