Commit 677c1e3
Fix nullable refetchedFragmentRef in checkSameIDAfterRefetch (#4945)
Summary:
I call useRefetchableFragment(), e.g. getSomethingById.
The backend may return null ("Something" no longer exists).
Then the queryData is `{node: null}`
fragmentRefPathInResponse is `['node']`
so fragmentRef (refetchedFragementRef) is `null`
and the
`var resultID = refetchedFragmentRef[ID_KEY]` throws `cannot read properties of null`.
Pull Request resolved: #4945
Test Plan: Updated to add unit tests
Reviewed By: lynnshaoyu
Differential Revision: D73461930
Pulled By: captbaritone
fbshipit-source-id: a98089cdcad8c29e13106fbf4e4aba2e8dc8fafd1 parent 91c22be commit 677c1e3Copy full SHA for 677c1e3
3 files changed
+3,278-3,239Lines changed: 3278 additions & 3239 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- packages/react-relay/relay-hooks
- __tests__
- legacy
Expand file treeCollapse file tree
Open diff view settings
0 commit comments