https://kotlinlang.org logo
Title
a

agrosner

05/11/2023, 1:05 PM
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

bod

05/11/2023, 1:18 PM
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

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