Mutation
mutation SetTrainingSites($siteIds: [Int!]!, $trainingId: String!) {
setTrainingSites(siteIds: $siteIds, trainingId: $trainingId) {
children {
__typename
}
id
isSite
location
parentId
tags
}
}Variables
{
"siteIds": [
1
],
"trainingId": "string"
}Response
{
"data": {
"setTrainingSites": [
{
"children": [
{
"__typename": "Location"
}
],
"id": 1,
"isSite": true,
"location": "string",
"parentId": 1,
"tags": [
"string"
]
}
]
}
}Mutations
setTrainingSites
Replaces the sites a training is restricted to and returns them. An empty siteIds makes the training available at every site.
MUTATION
setTrainingSites(siteIds: [Int!]!, trainingId: String!): [Location!]!Arguments
siteIds
[Int!]!
required
Ids of the sites the training is restricted to. Set as an empty list if there are no site restrictions.
trainingId
String!
required
Id of the training.
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 SetTrainingSites($siteIds: [Int!]!, $trainingId: String!) {
setTrainingSites(siteIds: $siteIds, trainingId: $trainingId) {
children {
__typename
}
id
isSite
location
parentId
tags
}
}Variables
{
"siteIds": [
1
],
"trainingId": "string"
}Response
{
"data": {
"setTrainingSites": [
{
"children": [
{
"__typename": "Location"
}
],
"id": 1,
"isSite": true,
"location": "string",
"parentId": 1,
"tags": [
"string"
]
}
]
}
}