-
-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot Page will Nullable Nested Objects: TypeError: Cannot set property '__typename' of null #768
Comments
Can you create a REPL on Codesandbox? |
Hiya 👋 I suspect that there may be a small issue with our resolver continuation when it switches over to cache data but that remains to be seen of course 🙌 |
I've got a fix ready; for future reference, the part that was unclear was In this case the bug is triggered, because |
This should be fixed in |
I confirmed that 2.4.1 works with my integration test. I wanted to get Codesandbox but ran into problems actually implementing relay pagination on the server side. That is what I get for being a pure ui dev for the past 8 months I guess. |
@sporieg We do have a PR (that's been closed for now) that just runs a GraphQL endpoint on a service worker, to make reproductions easier. But service workers don't play well with CodeSandbox yet 😅 I was able though to write a test for this rather quickly, which is a lot easier than building a whole full-stack reproduction: https://github.com/FormidableLabs/urql/pull/772/files#diff-9f4ddb48cfd743f31a643f5a4274f6bb |
urql: 2.3.0 +
Exchanges: @urql/exchange-graphcache, fetch
Steps to reproduce
I have a simple test, it will use
relayPagination
and fetch the first two pages.My code is slightly anomyzed from the real prod code but looks like
The query is like
Type definition like
Output in 2.2.2 (test passes)
Output in 2.3.0 (fails)
Output 2.4.0
Expected behavior
I expect it to page successfully.
This test will pass in 2.2.2, but fails in 2.3.0+
Actual behavior
A type error is throw from the cache exchange.
The text was updated successfully, but these errors were encountered: