Looking at <defer>, is there any docs on how to kn...
# apollo-kotlin
a
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?
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
is there a context variable we can use to distinguish emissions
b
on
ApolloResponse
there is a
isLast
property that you may be able to use for this?
(note that
@defer
is only applicable on fragments)
a
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
you may get several ( > 2) responses, and only the last one will have it set to true
a
Following up here - if the second request fails for some reason (server error, null ability, etc) how would we know?
b
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
ApolloResponse.errors
for other cases
thank you color 1