# import * from './database/generated/prisma.graphql'

type Query {
  currentUser: User!
  user(where: UserWhereUniqueInput!): User
  users(
    where: UserWhereInput
    orderBy: UserOrderByInput
    skip: Int
    after: String
    before: String
    first: Int
    last: Int
  ): [User!]!
  training(id: ID!): Training
  trainings(
    where: TrainingWhereInput
    orderBy: TrainingOrderByInput
    skip: Int
    after: String
    before: String
    first: Int
    last: Int
  ): [Training!]!
  trainingType(where: TrainingTypeWhereUniqueInput!): TrainingType
  trainingTypes(
    where: TrainingTypeWhereInput
    orderBy: TrainingTypeOrderByInput
    skip: Int
    after: String
    before: String
    first: Int
    last: Int
  ): [TrainingType!]!
  block(where: BlockWhereUniqueInput!): Block
  blocks(
    where: BlockWhereInput
    orderBy: BlockOrderByInput
    skip: Int
    after: String
    before: String
    first: Int
    last: Int
  ): [Block!]!
  format(where: FormatWhereUniqueInput!): Format
  formats(
    where: FormatWhereInput
    orderBy: FormatOrderByInput
    skip: Int
    after: String
    before: String
    first: Int
    last: Int
  ): [Format!]!
  exercise(where: ExerciseWhereUniqueInput!): Exercise
  exercises(
    where: ExerciseWhereInput
    orderBy: ExerciseOrderByInput
    skip: Int
    after: String
    before: String
    first: Int
    last: Int
  ): [Exercise!]!
}

type Mutation {
  createUser(data: UserCreateInput!): User!
  updateUser(email: String!, data: UserUpdateInput!): User
  deleteUser(email: String!): User
  createTraining(
    title: String!
    type: TrainingTypeCreateOneInput!
    trainingDate: DateTime!
    location: String!
    attendance: Int
    published: Boolean!
    blocks: BlockInstanceCreateManyWithoutParentTrainingInput
  ): Training!
  updateTraining(
    where: TrainingWhereUniqueInput!
    data: TrainingUpdateInput!
  ): Training!
  createTrainingType(name: String!, description: String!): TrainingType!
  # createBlock(
  #   title: String!
  #   description: String
  #   videos: [String!]
  #   pictures: [String!]
  #   duration: Int
  #   format: FormatCreateOneInput!
  #   rest: Int
  #   tracks: TrackCreateManyInput
  #   blocks: BlockInstanceCreateManyInput
  #   exercises: ExerciseInstanceCreateManyInput
  # ): Block!
  createFormat(name: String!, description: String!): Format!
  userLogin(email: String!, password: String!): User!
  userLogout: String!
  userSignup(name: String!, email: String!, password: String!): User!
  requestReset(email: String!): String!
  resetPassword(token: String!, password: String!): User!
  register(training: ID!): String!
  deregister(training: ID!): String!
}
