i’m using apollo graphql react sdk in my clojurescript project
i’m having an issue with the caching mechanism and the transformation of js object to cljs objects.
basically, in cljs i’m applying the function “js→clj” to the values return from apollo.
the issue happens when a query (watch query subscribe) is returned from cache and skips my js→clj call, and then i’m dealing with js object in my cljs env
i have tried writing a link for it that maps js object to cljs, but then apollo can’t write it to cache (i guess because it is looking for some key that changed its name)
so the question is, how can i modify the reads from all of the responses (including cache) and apply a tranformation function on them?
Of course you could also call js2Cli in yourCallback every time. You just have to be aware that you will get a new object again and again, and you’ll have to convert each of these new objects.