Skip to content

Possible to run updateQueryData before query is initiated  #2668

@frankleng

Description

@frankleng

I have an endpoint that doesn't need to fetch until a mutation occurs.

I'd like to implement optimistic update -
running updateQueryData once mutation starts, but has yet to be fulfilled..

but seems like running updateQueryData on an uninitiated query is a no-op. everything works fine if I fetch first.

is there a workaround? perhaps initiate it with empty state somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions