Looking at defer, is there any docs on how to know the loading and error states of the field? i.e. if we @defer on a nullable type, how could we distinguish between it
null
(not defined) and presently null?
agrosner
05/11/2023, 1:07 PM
i guess if we want to shimmer a carousel of product cards until it loads, if both emissions are
null
, then our shimmer state will remain. unless we begin counting emissions
agrosner
05/11/2023, 1:07 PM
is there a context variable we can use to distinguish emissions
b
bod
05/11/2023, 1:18 PM
on
ApolloResponse
there is a
isLast
property that you may be able to use for this?
bod
05/11/2023, 1:22 PM
(note that
@defer
is only applicable on fragments)
a
agrosner
05/11/2023, 2:28 PM
yeah. thats fine with fragments.
isLast
- would that work with multiple
@defer
- i.e. will server send back X number of responses for each
@defer
or will we get only a single secondary response
b
bod
05/11/2023, 2:29 PM
you may get several ( > 2) responses, and only the last one will have it set to true
a
agrosner
07/24/2023, 4:14 PM
Following up here - if the second request fails for some reason (server error, null ability, etc) how would we know?
b
bod
07/24/2023, 4:17 PM
errors are treated the same as usual with defer: you'll get an exception if it's a network issue, or you may get something in