Skip to content
Latchkey

What Is a Data Mutation?

A data mutation is any operation that changes server-side state, such as creating, updating, or deleting a record, in contrast to a read-only query. Because a mutation alters underlying data, it typically invalidates cached copies that no longer reflect reality. Client libraries model mutations separately from queries for this reason.

Why it matters

Distinguishing mutations from reads clarifies which operations must trigger cache invalidation and refetching. It is the foundation of patterns like optimistic UI and tag-based revalidation.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →