Author:
Fluent Commerce
Changed on:
5 Apr 2024
Mutations in GraphQL are operations designed to modify server-side data, encompassing the creation, updating, or deletion of records. They play a critical role in dynamic data management within GraphQL applications, allowing for precise and controlled data manipulation.
A GraphQL mutation is a type of operation used to modify data on the server. While queries are used to fetch data, mutations are used to create, update, or delete data.
Mutation operations are used for creating or updating data. All mutation operations take a single parameter and have the naming convention:
`<<mutationName>>(<<MutationNameInput>>):<<Type>>`
Examples:
`createOrder(CreateOrderInput): Order // Create Order mutation`
`updateOrder(UpdateOrderInput): Order // Update Order mutation`
Create mutations are used to create new data.
Update mutations are used for updating existing data.