wasyl
01/17/2022, 12:07 PMtag
to an Apollo call, so that the tag can be read in an okhttp3.Interceptor
class? The goal is to pass an object when triggering an Apollo call, and read it later from okhttp3.Request#tag()
in the interceptor.
Thereās https://github.com/apollographql/apollo-kotlin/issues/2527 so I assume there isnāt (though maybe something appeared in v3?) and that the only way to do that now is to set a request header, read it in the interceptor, and strip before sending to the server?mbonnin
01/17/2022, 12:12 PMApolloCall.addExecutionContext()
with your own contextwasyl
01/17/2022, 12:36 PMmbonnin
01/17/2022, 12:40 PMwasyl
01/17/2022, 12:43 PMStylianos Gakis
03/11/2022, 12:32 AM__typename = ""
to all of them right? If this is not in production code it should be fine?
With that said, if it does end up in production code, what does this break exactly? Not so proficient in the GraphQL spec tbh š
wasyl
03/11/2022, 7:54 AMmateusz.kwiecinski
03/11/2022, 8:09 AM__typename
I removed all of the models we had in favor of more functional tests with pre-recorded jsons.
If you prefer keeping models then maybe https://www.apollographql.com/docs/kotlin/testing/test-builders/ could help here?
According to the documentation
They automatically populate thefield and deduplicate merged fields whenever possible.__typename
if it does end up in production code, what does this break exactly?If you have queries structured like this it will cause cache misses. (basically you canāt reliably watch the cache due to missing
__typename
, and depending on your configuration, if there is an active watcher already itāll trigger refetch fetcher to make additional network call to fetch the missing __typename
value)
Our app heavily relies on valid cache so the 3774 is a blocker for us, weāre still on 2.xStylianos Gakis
03/11/2022, 8:40 AMtestdata
module, not used in production) version of the app we have where you can look browse like a list of possible cases at how screens would look like with different configurations and we use those builders to setup these different scenarios. We also use them for tests though sometimes so there I might have to be a bit more careful.
This is a bit irrelevant to my question but I just thought Iād give you some context as to why I am asking the question in the first place šwasyl
03/11/2022, 8:59 AMtypename
fields for you significantly. Depending on your schema it might be most models (for us itās almost everything). But overall what can break with wrong typename is caching, so if youāre only using the models statically for tests then having some empty typename shouldnāt be a big dealStylianos Gakis
03/11/2022, 9:03 AM