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

Old data still hanging around after a new request has errored #1820

Closed
dallonf opened this issue Mar 21, 2018 · 1 comment
Closed

Old data still hanging around after a new request has errored #1820

dallonf opened this issue Mar 21, 2018 · 1 comment
Labels
has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository

Comments

@dallonf
Copy link

dallonf commented Mar 21, 2018

Intended outcome:

Refetching a query that caused an error with new variables should clear out the old data and provide all the data that was returned from the GraphQL result.

Example: https://codesandbox.io/s/n73jj3x70
(this is the same code example as #1817)

Actual outcome:

I get the error alongside the data from the previous query.

How to reproduce the issue:

Example: https://codesandbox.io/s/n73jj3x70
(this is the same code example as #1817)

  1. Type a valid name: "Fred"
  2. Type a new name that throws an error: "Bob"

Note that the old data ("Hello, Fred!") is still hanging around.

Note react-apollo is at 2.1.0-rc.5; on the latest version (2.0.4), you will instead observe #1336, and the state will switch to loading: true but never actually make a request.

Version

@ghost ghost added the has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository label Mar 21, 2018
@rosskevin
Copy link
Contributor

Errored requests do not modify the cache. If you would like to see that change please file an issue with apollo-client.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository
Projects
None yet
Development

No branches or pull requests

2 participants