Skip to content

Allow developers to use retry-logic for mutations when they know it's safe#15

Merged
jpotter merged 1 commit intomainfrom
jeff-fix-12
Mar 18, 2021
Merged

Allow developers to use retry-logic for mutations when they know it's safe#15
jpotter merged 1 commit intomainfrom
jeff-fix-12

Conversation

@jpotter
Copy link
Contributor

@jpotter jpotter commented Mar 18, 2021

Background

Our client library has a simple retry implementation, intended to catch one-off transient errors that might happen in production. This is useful, for example, in cron jobs that loop over a large number of requests -- if a single transient error does occur, the client can issue a retry to avoid the developer using the library from having to handle those exceptions.

Previously, we removed that retry logic for mutation-based queries, as it's possible the transient error occurred after the mutation successfully executed, and double-running a mutation could put the data into an inconsistent state. However, sometimes a developer knows that the mutation is safe to replay.

Solution

Very simply: allow the developer to say, "it's okay to replay mutation" via a boolean flag.

@jpotter jpotter changed the title Allow deverlopers to use retry-logic for mutations when they know it's safe Allow developers to use retry-logic for mutations when they know it's safe Mar 18, 2021
@jpotter jpotter merged commit 9b757e8 into main Mar 18, 2021
@jpotter jpotter deleted the jeff-fix-12 branch March 18, 2021 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant