Closed dsonck92 closed 1 year ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 7617b923e73009c366fb08bd8907002588b75fbc:
Sandbox | Source |
---|---|
React | Configuration |
React Typescript | Configuration |
React Browserify | Configuration |
React Snowpack | Configuration |
Next.js | Configuration |
Next.js with custom Babel config | Configuration |
React with custom Babel config | Configuration |
Since it's already using an Observer
, and the watchQuery
returns an Observer
as well, all the logic can be reduced to just calling client.watchQuery
. At least this fixes the refresh on my own project.
I would consider any further features, other than just plainly handling the observer, out of scope and to be dealt with when the need arises.
Ah yes, it seems like there was a query mock in place that doesn't work anymore. I will try to rewrite the tests to use MockLink
from apollo instead so we can build on a more vanilla ApolloClient
later today.
Seems like the tests so far also get simplified by leveraging the MockLink. Currently tackling the refetch test but then it should work.
Locally I got all tests running. Main changes are:
MockLink
which goes through the cacheMath.random()
to a more predictable input so the MockLink
actually has known inputsThough I will say, I don't exactly know what that last function is really supposed to test. Though it does show it can retrigger the query getting function.
Closes: #9