Salesforce has introduced GraphQL mutations support in Lightning Web Components (LWC) via the `executeMutation` function from the `lightning/graphql` module. Developers can now create, update, and delete Salesforce records directly through GraphQL without writing custom Apex code. The feature supports dynamic query construction, bulk updates, and tree saves. Key data consistency notes include: newly created records require a query refresh to appear, updated fields may propagate automatically via Lightning Data Service, and deleted records are removed without requiring a refresh. Example implementations are available in the LWC Recipes GitHub repository.
Table of contents
Executing GraphQL mutations in LWC with executeMutationData consistency considerationsSee it in action: The LWC recipes showcaseDeveloper ResourcesAbout the AuthorsSort: