Learning journeys

English only

Use Cases

What is known in the Pluvo user interface as a learning journey is designated in the API as a Training. All actions related to learning journeys are handled through the Training entity in the GraphQL API.

Get single training

query {
  training(id: "uuid-here") {
    id
    title
    ref
    isActive
    archived
    startDate
    endDate
    subtitle
    introduction
  }
}

Get list

query {
  paginatedTrainings(q: "safety", first: 10, archived: false) {
    edges {
      node {
        id
        title
        ref
        isActive
        archived
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    count
  }
}

Create training

mutation {
  createTraining(training: {
    title: "Introduction to Safe Working"
    isActive: true
    ref: "safety-2024"
    subtitle: "Mandatory annual training"
    startDate: "2024-01-01T00:00:00Z"
    endDate: "2024-12-31T00:00:00Z"
    showParticipants: true
    enableChat: false
  }) {
    training {
      id
      title
      ref
    }
  }
}

Update training

mutation {
  updateTraining(
    ref: "safety-2024"
    training: {
      title: "Updated Title"
      isActive: false
    }
  ) {
    training {
      id
      title
      isActive
    }
  }
}

Archive/deactivate

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

GraphQL Definitions

Type

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

Queries

training(id: UUID, ref: String): Training
trainings(query: String): [TrainingListItem!] @deprecated(reason: "Use paginatedTrainings")
paginatedTrainings(
  q: String
  active: Boolean
  archived: Boolean
  first: Int
  after: String
  offset: Int
  sortBy: TrainingSortByInput
): TrainingListItemConnection

Mutations

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

CreateTrainingInput

FieldTypeRequiredDescription
titleStringYesTraining title
refStringNoExternal reference
subtitleStringNoSubtitle displayed below the title
introductionStringNoIntroduction text (HTML)
isActiveBooleanNoWhether the training is visible
startDateDateTimeNoTraining start date
endDateDateTimeNoTraining end date
estimatedTimeSpentStringNoEstimated time to complete
passThresholdFloatNoMinimum score to pass
showParticipantsBooleanNoShow participant list
showSharedFilesBooleanNoShow shared files section
enableChatBooleanNoEnable chat functionality
extraFieldsJSONStringNoLegacy extra fields

UpdateTrainingInput additionally supports archived (Boolean).

Notes

  • Use paginatedTrainings for list views — trainings is deprecated.
  • No deleteTraining mutation — use archiving via updateTraining with archived: true.
  • Both archived and isActive exist for backward compatibility. Prefer archived.
  • The ref field is your anchor for synchronization — always set it for externally managed trainings.
Schließ die Richtung