Local-only optimistic updates #1144
-
I'm trying to figure out an acceptable way to write Storybook stories. Ideally, I'd be looking for the following characteristics:
In a sense, the page state would reset after each reload, which would be perfect for a Storybook story, since engineers would be able to test basic user interactions without needing a database. To make it better, I wouldn't have to write mock mutations, because I'd be able to leverage the optimistic code (which, in a sense, already defines mock results). I'm trying to find out the best way to implement this strategy, and after looking at the documentation I have a few questions:
It's possible I'm going the completely wrong way, since I found few hints about this kind of workflow. Still, optimistic update definitions seem a great way to define in-memory mutations for development scenarios, and I wonder if there's something here I could leverage 🤔 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hey, Thanks for the detailed issue, one thing that I noticed is that you were referring to "creating your own fetch", we have a solution for this in place already. It's called the We chose not to expose the cache outside of GraphQL operations for the reason that this can introduce usages that lead to indeterministic behavior. |
Beta Was this translation helpful? Give feedback.
Hey,
Thanks for the detailed issue, one thing that I noticed is that you were referring to "creating your own fetch", we have a solution for this in place already. It's called the
execute-exchange
you can replace yourfetch-exchange
with this and get responses from there.We chose not to expose the cache outside of GraphQL operations for the reason that this can introduce usages that lead to indeterministic behavior.