Mutation
mutation SetPolicySites($policyId: String!, $siteIds: [Int!]!) {
setPolicySites(policyId: $policyId, siteIds: $siteIds) {
children {
__typename
}
id
isSite
location
parentId
tags
}
}Variables
{
"policyId": "string",
"siteIds": [
1
]
}Response
{
"data": {
"setPolicySites": [
{
"children": [
{
"__typename": "Location"
}
],
"id": 1,
"isSite": true,
"location": "string",
"parentId": 1,
"tags": [
"string"
]
}
]
}
}Mutations
setPolicySites
Replaces the sites a policy is restricted to and returns them. An empty siteIds makes the policy available at every site.
MUTATION
setPolicySites(policyId: String!, siteIds: [Int!]!): [Location!]!Arguments
policyId
String!
required
Id of the policy.
siteIds
[Int!]!
required
Ids of the sites the policy is restricted to. Set as an empty list if there are no site restrictions.
Returns
[Location!]!
children
[Location!]!
Locations directly under this one. Empty if there are no child locations.
id
Int!
Id of the location.
isSite
Boolean!
True when the location is a site.
location
String!
Name of the location.
parentId
Int
Id of the location this one sits under.
tags
[String!]
Where the location can be picked: any of 'inventory' (Inventory), 'inspections' (Inspections) or 'incidents' (Incidents). Empty if there are no tags.
Mutation
mutation SetPolicySites($policyId: String!, $siteIds: [Int!]!) {
setPolicySites(policyId: $policyId, siteIds: $siteIds) {
children {
__typename
}
id
isSite
location
parentId
tags
}
}Variables
{
"policyId": "string",
"siteIds": [
1
]
}Response
{
"data": {
"setPolicySites": [
{
"children": [
{
"__typename": "Location"
}
],
"id": 1,
"isSite": true,
"location": "string",
"parentId": 1,
"tags": [
"string"
]
}
]
}
}