123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- # import * from '../../../backend/database/generated/prisma.graphql'
- # Only some basic data to be able to display the training
- query trainingArchive($skip: Int, $first: Int) {
- trainingArchive(skip: $skip, first: $first) {
- trainings {
- id
- title
- type {
- name
- description
- }
- trainingDate
- location
- attendance
- blocks
- }
- totalCount
- }
- }
- # The full data set, single item.
- query training($id: ID) {
- training(id: $id) {
- ...displayTraining
- }
- }
- mutation deleteTraining($id: ID!) {
- deleteTraining(id: $id) {
- id
- }
- }
- # The full data set.
- query trainings(
- $where: TrainingWhereInput
- $orderBy: TrainingOrderByInput
- $skip: Int
- $after: String
- $before: String
- $first: Int
- $last: Int
- ) {
- count: trainingsCount(where: $where) {
- aggregate {
- count
- }
- }
- trainings(
- where: $where
- orderBy: $orderBy
- skip: $skip
- after: $after
- before: $before
- first: $first
- last: $last
- ) {
- ...displayTraining
- }
- }
- query trainingTypes {
- trainingTypes {
- id
- name
- description
- }
- }
- query formats {
- formats {
- id
- name
- description
- }
- }
- query blocks {
- blocks {
- ...blockWithoutBlocks
- blocks {
- ...blockInstanceWithoutBlock
- block {
- ...blockWithoutBlocks
- blocks {
- ...blockInstanceWithoutBlock
- block {
- ...blockWithoutBlocks
- }
- }
- }
- }
- }
- }
- query exercises {
- exercises {
- ...exerciseContent
- }
- }
- mutation createTraining(
- $title: String!
- $type: TrainingTypeCreateOneInput!
- $trainingDate: DateTime!
- $location: String!
- $attendance: Int!
- $published: Boolean!
- $blocks: BlockInstanceCreateManyWithoutParentTrainingInput
- ) {
- createTraining(
- title: $title
- type: $type
- trainingDate: $trainingDate
- location: $location
- attendance: $attendance
- published: $published
- blocks: $blocks
- ) {
- id
- }
- }
- mutation updateTraining($where: TrainingWhereUniqueInput!, $data: TrainingUpdateInput!) {
- updateTraining(where: $where, data: $data) {
- id
- }
- }
- mutation createTrainingType($name: String!, $description: String!) {
- createTrainingType(name: $name, description: $description) {
- id
- }
- }
- mutation createFormat($name: String!, $description: String!) {
- createFormat(name: $name, description: $description) {
- id
- }
- }
- mutation register($training: ID!) {
- register(training: $training) {
- id
- }
- }
- mutation deregister($training: ID!) {
- deregister(training: $training) {
- id
- }
- }
- mutation publish($training: ID!, $status: Boolean) {
- publish(training: $training, status: $status) {
- id
- }
- }
- fragment exerciseContent on Exercise {
- id
- name
- description
- videos {
- id
- title
- }
- pictures {
- id
- title
- }
- targets
- baseExercise
- }
- fragment blockWithoutBlocks on Block {
- id
- title
- description
- videos {
- id
- title
- }
- pictures {
- id
- title
- }
- duration
- format {
- id
- name
- description
- }
- rest
- exercises {
- id
- exercise {
- ...exerciseContent
- }
- order
- repetitions
- variation
- }
- }
- fragment blockInstanceWithoutBlock on BlockInstance {
- id
- order
- rounds
- variation
- }
- fragment displayTraining on Training {
- id
- title
- type {
- id
- name
- description
- }
- createdAt
- trainingDate
- location
- attendance
- published
- blocks {
- ...blockInstanceWithoutBlock
- block {
- ...blockWithoutBlocks
- blocks {
- ...blockInstanceWithoutBlock
- block {
- ...blockWithoutBlocks
- blocks {
- ...blockInstanceWithoutBlock
- block {
- ...blockWithoutBlocks
- blocks {
- ...blockInstanceWithoutBlock
- block {
- ...blockWithoutBlocks
- blocks {
- id
- }
- }
- }
- }
- }
- }
- }
- }
- }
- registrations {
- id
- name
- }
- }
- fragment editTraining on Training {
- id
- createdAt
- title
- type {
- id
- name
- description
- }
- createdAt
- trainingDate
- location
- attendance
- published
- blocks {
- ...blockInstanceWithoutBlock
- block {
- ...blockWithoutBlocks
- blocks {
- ...blockInstanceWithoutBlock
- block {
- ...blockWithoutBlocks
- blocks {
- ...blockInstanceWithoutBlock
- block {
- ...blockWithoutBlocks
- blocks {
- ...blockInstanceWithoutBlock
- block {
- ...blockWithoutBlocks
- blocks {
- id
- }
- }
- }
- }
- }
- }
- }
- }
- }
- registrations {
- id
- name
- }
- }
|