Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

When variables change, data is the previous result in Query Component #2202

@asafigan

Description

@asafigan

I am using the "cache-and-network" policy.

Intended outcome:
Rerender Query with different variables. Data is {} until new request is resolved from cache or network.

Actual outcome:
Rerender Query with different variables. Returns previous data until next query is resolved without error.

How to reproduce the issue:
https://stackblitz.com/edit/react-snlwzf
change the input and hit submit.

Version

  • apollo-client@
  • react-apollo@
  • has-reproduction
  • feature
  • docs
  • blocking
  • good first issue

Backgroud
I only want to display a loading state if I don't have a response from the cache or network, but I do want to show loading state when variables change and I don't have a response from cache. Right now it is impossible to tell if data is the response from cache or if it is the previous result. Loading property is no help because it is allows true until the network request is resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    has-reproduction❤ Has a reproduction in a codesandbox or single minimal repository

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions