Skip to main content

saveControl

Requires permission settings:controls:manage.

Creates a control (it starts in observe unless sent as off) or updates one's rule. Refused with CONTROL_RULE_INVALID when the rule fails validation, or CONTROL_NO_ELIGIBLE_APPROVER when nobody other than you could approve it. Requires settings:controls:manage.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation SaveControl($input: SaveControlInput!) {
saveControl(input: $input) {
id
name
archived
checkpoint
invalid
invalidReason
conditions {
number
fact
flag
list
op
text
}
}
}

Variables:

{
"input": {
"checkpoint": "string",
"conditions": [
{
"fact": "string",
"op": "string",
"value": {}
}
],
"join": "string",
"name": "string",
"outcome": {
"kind": "string"
}
}
}

Response:

{
"data": {
"saveControl": {
"id": "id",
"name": "string",
"archived": true,
"checkpoint": "string",
"invalid": true,
"invalidReason": "string",
"conditions": [
{
"number": 0,
"fact": "string",
"flag": true,
"list": [
"string"
],
"op": "string",
"text": "string"
}
]
}
}
}
saveControl(
input: SaveControlInput!
): ControlRuleType!

Arguments​

saveControl.input ● SaveControlInput! non-null input​

The control to create or update.

Type​

ControlRuleType object​

A control: one rule checked at one checkpoint, with its mode and recent decisions.