Training / Leerlijnen

English only

Use Cases

What is known in the Pluvo user interface as a learning path is designated in the API as a Training. All actions related to learning paths—such as creating, editing, connecting participants, or adding modules—are therefore handled through the Training entity in the GraphQL API.

Get single object

Retrieves one specific training via id or ref. Often used to fetch details and modules of a training.

query {
  training(id: "uuid-here") {
    id
    title
    ref
    isActive
    portfolioItem {
      id
    }
  }
}

Get list

Use paginatedTrainings to retrieve trainings with filtering, pagination, and sorting.

query {
  paginatedTrainings(q: "safety", first: 10) {
    edges {
      node {
        id
        title
        isActive
      }
    }
  }

Create training

Creates a new training with title and optionally other metadata such as start date and ref.

mutation {
  createTraining(training: {
    title: "Introduction to Safe Working"
    isActive: true
    ref: "safety-2024"
  }) {
    training {
      id
      title
      ref
    }
  }
}

Update training

Modifies data of an existing training such as title, visibility, or metadata.

mutation {
  updateTraining(
    id: "uuid-here"
    training: {
      title: "Updated Title"
      archived: true
    }
  ) {
    training {
      id
      title
      archived
    }
  }
}

Archive/deactivate

Sets the training to archived or inactive. Useful for hiding old trainings.

mutation {
  updateTraining(
    id: "uuid-here"
    training: {
      isActive: false
      archived: true
    }
  ) {
    training {
      id
      isActive
      archived
    }
  }
}

GraphQL Definitions

Type

The Training type contains the structure of a learning path, including metadata, visibility, and relationships to users, files, and modules.

type Training {
  id: UUID!
  title: String!
  subtitle: String
  introduction: String
  ref: String
  isActive: Boolean!
  archived: Boolean!
  overviewImage: File
  startDate: Date
  endDate: Date
  estimatedTimeSpent: String
  portfolioItem: PortfolioItemListItem
  users: [User!]
  participants(...): TrainingUserConnection!
  trainers(...): TrainingUserConnection!
  modules: [Module!]!
}

Queries

Use the following queries to retrieve trainings:

training(id: UUID, ref: String): Training
trainings(query: String): [TrainingListItem!] @deprecated
paginatedTrainings(q: String, active: Boolean, archived: Boolean): TrainingListItemConnection

Mutations

For creating and modifying trainings:

createTraining(training: CreateTrainingInput!): CreateTraining
updateTraining(id: UUID, ref: String, training: UpdateTrainingInput!): UpdateTraining

Notes

  • Use paginatedTrainings for list views with filters.
  • The fields archived and isActive are present for management.
  • No deleteTraining mutation — use archiving instead.
Close notification