Back to website: www.pluvo.com
<aside> 💡 See schema for more information about the schema.
</aside>
type Training {
id: UUID!
isActive: Boolean!
title: String!
subtitle: String!
introduction: String!
image: File
startDate: Date @deprecated(reason: "Replaced by the AbsoluteDateCondition")
endDate: Date @deprecated(reason: "Replaced by the AbsoluteDateCondition")
users: [User!]!
groups: [Group!]!
showParticipants: Boolean!
showSharedFiles: Boolean!
enableChat: Boolean!
ref: String
rolesForCurrentUser: [TrainingRole!]
allConditionsFulfilled: Boolean!
conditions: [Condition!]!
nextEvent: DateTime
progress: Float
}
Get a list of all trainings in your organization.
query paginatedTrainings {
paginatedTrainings {
edges {
node {
ref
title
}
}
}
}
Get a single training in your organization. You can use the ref
of the training to get it.
query training {
training(ref: "training-ref") {
ref
title
}
}
Get a list of all trainings for a specific userId
in your organisation. Only managers, planner or group manager can view this information. You can filter on trainingUserRoles
to only get trainings where the user has a specific role (PARTICIPANT
, TRAINER
or MENTOR
).
query paginatedTrainings {
paginatedTrainings(userId: "00000000-0000-0000-0000-000000000000", trainingUserRoles: [PARTICIPANT]) {
edges {
node {
ref
title
userData {
progress
}
}
}
}
}
Create a new training in your organization, you can pass your own custom ref
.
mutation createTraining {
createTraining(training: {ref: "training-ref", title: "Test Training", startDate: "2020-01-01"}) {
training {
ref
title
}
}
Update a training using ref
.
mutation updateTraining {
updateTraining(ref: "training-ref", training: {title: "New title"}) {
training {
ref
title
}
}
}
To disable a training we can archive it. This can be done via the updateTraining
mutation.
mutation updateTraining {
updateTraining(ref: "training-ref", training: {isActive: false}) {
training {
ref
title
isActive
}
}
}
You can add multiple users to a training by using refs.
Possible roles you can pass: PARTICIPANT
, TRAINER
, MENTOR
Note: This action isn't done instant, so it can take a few minutes to be done
mutation addUsersToTraining {
addUsersToTraining(role: PARTICIPANT, sendInvites: true, trainingRef: "training-ref", userRefs: ["user-ref", "user-2-ref"]) {
addedRefs # Refs of users that are added
alreadyAddedRefs # Refs of users that are already in the training
failedRefs # Refs of users that are incorrect
}
}
You can add remove users from a training by using refs.
Possible roles you can pass: PARTICIPANT
, TRAINER
, MENTOR
Note: This action isn't done instant, so it can take a few minutes to be done
mutation removeUsersFromTraining {
removeUsersFromTraining(role: PARTICIPANT, trainingRef: "training-ref", userRefs: ["user-ref", "user-2-ref"]) {
removedRefs # Refs of users that are removed
alreadyRemovedRefs # Refs of users that are not in the training
failedRefs # Refs of users that are incorrect
}
}