---
schema_version: "1"
id: 1cc0f67c59956296c5a0a9d1bf1743611630e7fc3440cb31e8266f40eb994023
title: Mutations Schema
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/graphql-api/graphql/guides/mutations/mutations-schema.md
canonical_url: https://developer.salesforce.com/docs/platform/graphql/guide/mutations-schema.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: c0f39c3765d23dcd6e449c9abc33ed940b7b17dfa22354ffcf8acfadb085b963
products:
  - GraphQL API
---
# Mutations Schema

| AVAILABLE API VERSION               |
| ----------------------------------- |
| Beta v59.0–65.0                     |
| Generally available v66.0 and later |

The [`Mutation` operation type](https://developer.salesforce.com/docs/platform/graphql/guide/mutations-intro.md) has a `uiapi` field with a `UIAPIMutationsInput` argument. The `UIAPIMutationsInput` argument has a boolean argument `allOrNone` that has a default value of `true`. When `true`, if one or more operations fail, all operations are rolled back and not executed.

```
type Mutation {
  uiapi(input: UIAPIMutationsInput): UIAPIMutations!
}

input UIAPIMutationsInput {
  allOrNone: Boolean
}
```

Use mutations to create, update, or delete records. Under the `UIAPIMutations` type, each Salesforce object corresponds to a `RecordCreate`, `RecordEdit`, and `RecordDelete` field that accepts a response payload you define. Only [objects supported by UI API](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_get_started_supported_objects.htm) are available for mutations.

The context user’s [object-level and field-level permissions](https://developer.salesforce.com/docs/atlas.en-us.securityImplGuide.meta/securityImplGuide/security_data_access.htm) control access to supported objects and fields on those objects. An object is accessible if the user has the correct permissions, and the object is either on the supported object list or is a custom object. For create mutations, the context user must have read access to the new record.

**note:** To view the GraphQL API schema via introspection, use the [Altair GraphQL Client](https://developer.salesforce.com/docs/platform/graphql/get-started-graphql.md).

## UIAPIMutations Type

The `UIAPIMutations` type has three fields—`RecordCreate`, `RecordDelete`, and `RecordUpdate`—for each object type accessible to the user. Here’s the `Account` example.

```
type UIAPIMutations {
  AccountCreate ( input AccountCreateInput!
  ): AccountCreatePayload
  AccountDelete ( input RecordDeleteInput!
  ): RecordDeletePayload
  AccountUpdate ( input AccountUpdateInput!
  ): AccountUpdatePayload
}
```

The `UIAPIMutations` type contains fields for creating, deleting, and updating records.

## RecordCreate Field

The `RecordCreate` field accepts the `RecordCreateInput` object type as an argument with a `RecordCreateRepresentation` type. Here’s the `AccountCreateInput` example.

```
input AccountCreateInput {
  Account: AccountCreateRepresentation!
}
```

The `RecordCreateRepresentation` type represents the record view after the create mutation operation completes. The `RecordCreateRepresentation` differs from the `RecordRepresentation` that is used for querying records. The `RecordCreateRepresentation` excludes foreign key details (other than ID) and child relationships because the related objects aren’t part of the mutation operation.

Here’s the `AccountCreateRepresentation` example.

```
type AccountCreateRepresentation {
  AccountNumber: String
  AccountSource: Picklist
  AnnualRevenue: Currency
  # Other Account fields
}
```

The input type for `RecordCreate` contains fields that are createable. Required fields must be non-null. If you don’t include the `OwnerId` field, it’s set to the context user.

**note:** The `Id` field isn’t included in the `RecordCreateRepresentation` type.

## RecordCreatePayload Type

The `RecordCreatePayload` type returns the result of record creation. It returns a `Record` object with its corresponding fields. Here’s the `AccountCreatePayload` example.

```
type AccountCreatePayload {
  Record: Account
}
```

The `Record` object maps to a Salesforce object and its fields. If record creation is successful, the response payload also contains the `Id` of the new record.

## RecordDelete Field

The `RecordDelete` field accepts the `RecordDeleteInput` object type as an argument. Here’s the `AccountDeleteInput` example.

```
input AccountDeleteInput {
  Id: IdOrRef!
}
```

## RecordDeletePayload Type

The `RecordDeletePayload` type returns the `Id` field of the deleted record. Here’s the `AccountDeletePayload` example.

```
type AccountDeletePayload {
  Id: ID
}
```

## RecordUpdate Field

The `RecordUpdate` field accepts the `RecordUpdateInput` object type as an argument with a `RecordUpdateRepresentation` type. Here’s the `AccountUpdateInput` example.

```
input AccountUpdateInput {
  Account: AccountUpdateRepresentation!
  Id: IdOrRef!
}
```

The `RecordUpdateRepresentation` type represents the record view after the update mutation operation completes. The `RecordUpdateRepresentation` differs from the `RecordRepresentation` that is used for querying records. The `RecordUpdateRepresentation` excludes foreign key details (other than ID) and child relationships because the related objects aren’t part of the mutation operation.

Here’s the `AccountUpdateRepresentation` example.

```
type AccountUpdateRepresentation {
  AccountNumber: String
  AccountSource: Picklist
  AnnualRevenue: Currency
  # Other Account fields
}
```

The input type for `RecordUpdate` contains fields that are updateable. It includes a non-null `Id` field for specifying which record to update.

**note:** The `Id` field isn’t included in the `RecordUpdateRepresentation` type.

## RecordUpdatePayload Type

The `RecordUpdatePayload` type returns the result of record update. It returns a `Record` object with its corresponding fields. Here’s the `AccountUpdatePayload` example.

```
type AccountUpdatePayload {
  Record: Account
}
```

The `Record` object maps to a Salesforce object and its fields.

**note:** The `RecordUpdatePayload` type includes the `Record` field in API v66.0 and later. In API v59–65, the `RecordUpdatePayload` type includes a `success` field returning `true` or `false` to denote if the update is successful.
