Replies: 1 comment 6 replies
-
|
Currently we're purposefully not supporting this. Because if there was an API for this arguably it's UI state on which mutations are pending and which should be pending. I do also see the perspective of "optimising" mutations, but the question is whether that's something you'd rather do in the transport by adding some kind of debounce + filter. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm bringing some more feedback around the offline scenario in hope you find this useful. This time it's an idea more than a bug report :)
For reference, I'm developing a native app which will run on mobile devices. These devices are expected to get offline for stretches of time during which users can create entities, let's call them "recommendations".
For this purpose I'm using an optimistic mutation which creates an entity with a randomly assigned ID.
As of #1073 we can successfully create a number of recommendations while offline, which get applied when the device gets back online. Now imagine the following scenario: a user creates two recommendations, then deletes one of them, all the time while the device is offline. When the device gets back online, this currently triggers the following mutations
The last one fails because we don't know the entity's actual ID and the server rejects
temporaryID1.One way to support this use case would be to allow users to cancel scheduled optimistic mutations. I can't think of an obvious API and it's admittedly a bit of an edge case but I thought I'd bring it up for discussion. Do you think it's a generic enough scenario that's worth supporting?
As a workaround I'm hiding the UI elements that trigger entity deletion while the entity has a temporary ID (ie. it has not been synced with the server).
Beta Was this translation helpful? Give feedback.
All reactions