My goal is to save some specific query results from graphql server to local storage.
At the same time, I would like to know if there are any updates on the server-side, and probably refetch those parts that were missing previously and save them to local storage again.
I saw this article
I found that I can use @client 0 but I did not find a proper description of that. It says:
“To do so, you add the
@client directive to every client-side field in your query. This tells Apollo Client not to fetch that field’s value from your server.”
Does it mean it would take data from the cache? Or local storage? Or what happened if there is no data? Would it make a request or throw error?
I tried to use presistedCache library, but it seems to me it put into local storage everything. But I do not need to put everything, I just need to put specific queries here. But I could not find any documentation about it. Also, I do not sure how it works at all. Does it get data automatically from local storage or should I get it from there somehow?