query + variables A return dataA and no errors
query + variables B return no data and errorB
Intended outcome:
Running a query Using Query Component initially with set of variables A that returns dataA and no errors.
Query is now updated with another set of variables B that returns errorB and no data.
Updating Query again with A variables should return dataA and no errors in render props.
Actual outcome:
a. In step 2 render props returns twice
network status: 2, data: dataA, error: undefined
network status: 7, data: dataA, error: errorB
b. In step 3 render props returns once
network status : 7 (as this already ran in 1), data: dataA (last successful data ) and error: errorB (from 2)
Problem:
why in 'a' data is present although that query didn't return data ?
'b' returning error from previous call although this call cached data has no errors?
also the data returned in 'b is not based on it's cached data but the last successfully received data (tested with another variable set)
Initially thought this is related to error issues with refetch, which may not be the case. This is most common behaviour expected from the package so this is a major bug.
for issue at 'b' at this line correct result is picked, but further querySet and querState init are called and finally errors from previous query are thrown here
Work Around:
I was able to fix the issue in step 'b' by not passing previous errors into updation of querystore setting [] here however I don't know the side effects of this. (If at all only network errors should be passed on)
query + variables A return dataA and no errors query + variables B return no data and errorB
Intended outcome:
Actual outcome: a. In step 2 render props returns twice
b. In step 3 render props returns once
Problem: why in 'a' data is present although that query didn't return data ? 'b' returning error from previous call although this call cached data has no errors? also the data returned in 'b is not based on it's cached data but the last successfully received data (tested with another variable set)
Initially thought this is related to error issues with refetch, which may not be the case. This is most common behaviour expected from the package so this is a major bug.
for issue at 'b' at this line correct result is picked, but further querySet and querState init are called and finally errors from previous query are thrown here
Work Around: I was able to fix the issue in step 'b' by not passing previous errors into updation of querystore setting [] here however I don't know the side effects of this. (If at all only network errors should be passed on)
How to reproduce the issue:
Versions
System: OS: macOS High Sierra 10.13.6 Binaries: Node: 8.11.2 - /usr/local/bin/node Browsers: Chrome: 67.0.3396.99 Firefox: 61.0.1 Safari: 11.1.2 npmPackages: apollo-boost: 0.1.4 => 0.1.4 apollo-cache-inmemory: 1.2.5 => 1.2.5 apollo-client: 2.3.7 => 2.3.7 apollo-link: 1.2.2 => 1.2.2 apollo-link-batch-http: 1.2.2 => 1.2.2 apollo-link-error: 1.1.0 => 1.1.0 apollo-link-state: 0.4.1 => 0.4.1 react-apollo: 2.1.9 => 2.1.9