Skip to content

JSON mutation examples

Example 1

In this example we would like to update an object with id 123456789 with the value value1 for fieldSystemNameOrfieldId1 and value2 for field fieldSystemNameOrfieldId2.

Simple

1
2
3
{
    "query": "mutation { updateItems(items: { id: 123456789, fields: { fieldSystemNameOrfieldId1: \"value1\", fieldSystemNameOrfieldId2: \"value2\" } }) }"
}

With variables

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "query": "mutation UpdateItems($input: [UpdateItemInput!]!) { updateItems(items: $input) }",
    "variables": {
        "input": [
            {
                "id": 123456789,
                "fields": {
                    "fieldSystemNameOrfieldId1": "value1",
                    "fieldSystemNameOrfieldId2": "value2"
                }
            }
        ]
    }
}