How to manually normalize data into Graphcache? #1362
-
My app client, running in the browser, fetches search results from a third-party service. I'd like to normalize these results into Graphcache. Is there a way to do this? I looked into these solutions but they seem like dead ends:
Ideally, there would be some way for me to directly manipulate the store, but I don't see how I can do this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey, We aim to have graphCache be a representation of your server-side state, this makes a lot of cases more deterministic, hence why we don't allow cache updates outside of mutations/subscriptions. My advice most often would be to write this inside these transformations inside of React-land, this way the data will keep representing the query. If the transformation is just a data-formatter or something you could use the resolvers API. |
Beta Was this translation helpful? Give feedback.
Hey,
We aim to have graphCache be a representation of your server-side state, this makes a lot of cases more deterministic, hence why we don't allow cache updates outside of mutations/subscriptions.
My advice most often would be to write this inside these transformations inside of React-land, this way the data will keep representing the query.
If the transformation is just a data-formatter or something you could use the resolvers API.