The Update mutation is used to modify existing records in Standard and External object types.
To update records, the system provides a GraphQL mutation API in the format update + API name, where the API name is defined during object creation. This mutation allows users to update one or more fields of an existing record.
Users must provide the primary key to identify the record to be updated. The fields to be modified should be specified under the patch node with their new values. Only the fields included in the patch are updated; all other fields remain unchanged.
mutation MyMutation {
updateexternalObj_API(input: {patch: {age: 90}, externalObj_id: "40"}) {
clientMutationId
externalObj_API {
age
name
}
}
}
During execution, the input data is validated against the object schema to ensure correctness and data integrity.
On successful execution, the mutation returns the updated record. The response includes only the fields explicitly selected in the query, allowing users to control which data is returned.
If required inputs are missing, the primary key is invalid, or provided values do not conform to the schema, the mutation fails and returns appropriate error messages.