A mutation changes server-side data. Because GraphQL sends reads and writes over HTTP POST, the HTTP verb alone cannot make a mutation safe to retry. If a payment request times out, retrying it without protection could charge the customer twice. section 6.4.2
For safer retries, the client sends a unique idempotency key with the mutation. The server records the key when it processes the payment; if the same key arrives again, it skips the payment and returns the original success response. section 6.4.2
Listing 6.3 GraphQL Mutation with Idempotency Key
# The Client sends the mutation with a unique key
mutation {
processPayment(
amount: 50.00,
idempotencyKey: "a1b2c3d4-e5f6-7890-1234-56789abcdef0"
) {
status
transactionId
}
}The payment example includes an amount, a unique idempotency key, and fields requested in the response. section 6.4.2


