You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click on the Lookup a person by ID with an empty input.
This will pass null as from.id to useFragment.
@apollo/client version
3.8.9 and later
The text was updated successfully, but these errors were encountered:
kouak
changed the title
useFragment invalid return value in the case of null or undefined id in the from argument
useFragment invalid return value when the store object does not exist
Feb 15, 2024
kouak
changed the title
useFragment invalid return value when the store object does not exist
useFragment invalid return value in the case of null or undefined id in the from argument
Feb 15, 2024
Issue Description
When using
useFragment
, I'm expecting some sort of error or warning if I try to read an object with anull
orundefined
id.This also does not match the typescript return type of
useFragment<TData>();
. Whencomplete
istrue
,data
should be of typeTData
.A workaround is to pass an empty string or
false
asid
.Link to Reproduction
https://codesandbox.io/p/devbox/recursing-tesla-4f6vt3
Reproduction Steps
Click on the
Lookup a person by ID
with an empty input.This will pass
null
asfrom.id
touseFragment
.@apollo/client
version3.8.9 and later
The text was updated successfully, but these errors were encountered: