|
@@ -12,6 +12,7 @@ export type Scalars = {
|
|
|
Int: number,
|
|
|
Float: number,
|
|
|
DateTime: any,
|
|
|
+ Upload: any,
|
|
|
};
|
|
|
|
|
|
export type Block = Node & {
|
|
@@ -1358,6 +1359,20 @@ export type ExerciseWhereUniqueInput = {
|
|
|
id?: Maybe<Scalars['ID']>,
|
|
|
};
|
|
|
|
|
|
+export type File = Node & {
|
|
|
+ id: Scalars['ID'],
|
|
|
+ createdAt: Scalars['DateTime'],
|
|
|
+ updatedAt: Scalars['DateTime'],
|
|
|
+ path: Scalars['String'],
|
|
|
+ mimetype: Scalars['String'],
|
|
|
+ user: User,
|
|
|
+ thumbnail?: Maybe<Scalars['String']>,
|
|
|
+ filename: Scalars['String'],
|
|
|
+ encoding: Scalars['String'],
|
|
|
+ size: Scalars['Int'],
|
|
|
+ comment?: Maybe<Scalars['String']>,
|
|
|
+};
|
|
|
+
|
|
|
export type Format = Node & {
|
|
|
id: Scalars['ID'],
|
|
|
name: Scalars['String'],
|
|
@@ -1495,7 +1510,16 @@ export type FormatWhereUniqueInput = {
|
|
|
id?: Maybe<Scalars['ID']>,
|
|
|
};
|
|
|
|
|
|
+export type FsFile = {
|
|
|
+ filename: Scalars['String'],
|
|
|
+ path: Scalars['String'],
|
|
|
+ size: Scalars['Int'],
|
|
|
+ ctime: Scalars['DateTime'],
|
|
|
+ mtime: Scalars['DateTime'],
|
|
|
+};
|
|
|
+
|
|
|
export type Mutation = {
|
|
|
+ uploadFile: File,
|
|
|
createUser: User,
|
|
|
updateUser?: Maybe<User>,
|
|
|
deleteUser?: Maybe<User>,
|
|
@@ -1513,6 +1537,12 @@ export type Mutation = {
|
|
|
};
|
|
|
|
|
|
|
|
|
+export type MutationUploadFileArgs = {
|
|
|
+ file: Scalars['Upload'],
|
|
|
+ comment?: Maybe<Scalars['String']>
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
export type MutationCreateUserArgs = {
|
|
|
data: UserCreateInput
|
|
|
};
|
|
@@ -1603,11 +1633,14 @@ export enum Permission {
|
|
|
}
|
|
|
|
|
|
export type Query = {
|
|
|
+ fsFiles: Array<FsFile>,
|
|
|
+ files: Array<File>,
|
|
|
currentUser: User,
|
|
|
user?: Maybe<User>,
|
|
|
users: Array<User>,
|
|
|
training?: Maybe<Training>,
|
|
|
trainings: Array<Training>,
|
|
|
+ publishedTrainings: Array<Training>,
|
|
|
trainingType?: Maybe<TrainingType>,
|
|
|
trainingTypes: Array<TrainingType>,
|
|
|
block?: Maybe<Block>,
|
|
@@ -1619,6 +1652,11 @@ export type Query = {
|
|
|
};
|
|
|
|
|
|
|
|
|
+export type QueryFsFilesArgs = {
|
|
|
+ directory: Scalars['String']
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
export type QueryUserArgs = {
|
|
|
where: UserWhereUniqueInput
|
|
|
};
|
|
@@ -2766,6 +2804,7 @@ export type TrainingWhereUniqueInput = {
|
|
|
id?: Maybe<Scalars['ID']>,
|
|
|
};
|
|
|
|
|
|
+
|
|
|
export type User = Node & {
|
|
|
id: Scalars['ID'],
|
|
|
email: Scalars['String'],
|
|
@@ -3314,22 +3353,25 @@ export type UserWhereUniqueInput = {
|
|
|
email?: Maybe<Scalars['String']>,
|
|
|
};
|
|
|
|
|
|
-export type ExerciseContentFragment = (
|
|
|
- Pick<ExerciseInstance, 'id' | 'order' | 'repetitions' | 'variation'>
|
|
|
- & { exercise: Pick<Exercise, 'id' | 'name' | 'description' | 'videos' | 'pictures' | 'targets' | 'baseExercise'> }
|
|
|
-);
|
|
|
+export type ExerciseContentFragment = Pick<Exercise, 'id' | 'name' | 'description' | 'videos' | 'pictures' | 'targets' | 'baseExercise'>;
|
|
|
|
|
|
export type BlockContentFragment = (
|
|
|
Pick<Block, 'id' | 'title' | 'description' | 'videos' | 'pictures' | 'duration' | 'rest'>
|
|
|
& { format: Pick<Format, 'id' | 'name' | 'description'>, blocks: Maybe<Array<(
|
|
|
Pick<BlockInstance, 'id' | 'order' | 'rounds' | 'variation'>
|
|
|
& { block: BlockHintFragment }
|
|
|
- )>>, exercises: Maybe<Array<ExerciseContentFragment>> }
|
|
|
+ )>>, exercises: Maybe<Array<(
|
|
|
+ Pick<ExerciseInstance, 'id' | 'order' | 'repetitions' | 'variation'>
|
|
|
+ & { exercise: ExerciseContentFragment }
|
|
|
+ )>> }
|
|
|
);
|
|
|
|
|
|
export type BlockHintFragment = (
|
|
|
Pick<Block, 'id' | 'title' | 'description' | 'videos' | 'pictures' | 'duration' | 'rest'>
|
|
|
- & { format: Pick<Format, 'id' | 'name' | 'description'>, blocks: Maybe<Array<Pick<BlockInstance, 'id'>>>, exercises: Maybe<Array<ExerciseContentFragment>> }
|
|
|
+ & { format: Pick<Format, 'id' | 'name' | 'description'>, blocks: Maybe<Array<Pick<BlockInstance, 'id'>>>, exercises: Maybe<Array<(
|
|
|
+ Pick<ExerciseInstance, 'id' | 'order' | 'repetitions' | 'variation'>
|
|
|
+ & { exercise: ExerciseContentFragment }
|
|
|
+ )>> }
|
|
|
);
|
|
|
|
|
|
export type SubBlockFragment = (
|
|
@@ -3352,6 +3394,51 @@ export type TrainingQuery = { training: Maybe<(
|
|
|
& { type: Pick<TrainingType, 'id' | 'name' | 'description'>, blocks: Maybe<Array<SubBlockFragment>>, registrations: Maybe<Array<Pick<User, 'id' | 'name'>>> }
|
|
|
)> };
|
|
|
|
|
|
+export type DisplayTrainingFragment = (
|
|
|
+ Pick<Training, 'id' | 'title' | 'trainingDate' | 'location' | 'attendance'>
|
|
|
+ & { type: Pick<TrainingType, 'id' | 'name' | 'description'>, blocks: Maybe<Array<(
|
|
|
+ { block: (
|
|
|
+ { blocks: Maybe<Array<(
|
|
|
+ { block: (
|
|
|
+ { blocks: Maybe<Array<(
|
|
|
+ { block: (
|
|
|
+ { blocks: Maybe<Array<Pick<BlockInstance, 'id'>>> }
|
|
|
+ & DisplayBlockFragment
|
|
|
+ ) }
|
|
|
+ & DisplayBlockInstanceFragment
|
|
|
+ )>> }
|
|
|
+ & DisplayBlockFragment
|
|
|
+ ) }
|
|
|
+ & DisplayBlockInstanceFragment
|
|
|
+ )>> }
|
|
|
+ & DisplayBlockFragment
|
|
|
+ ) }
|
|
|
+ & DisplayBlockInstanceFragment
|
|
|
+ )>>, registrations: Maybe<Array<Pick<User, 'id'>>> }
|
|
|
+);
|
|
|
+
|
|
|
+export type DisplayBlockInstanceFragment = Pick<BlockInstance, 'id' | 'order' | 'rounds' | 'variation'>;
|
|
|
+
|
|
|
+export type DisplayBlockFragment = (
|
|
|
+ Pick<Block, 'id' | 'title' | 'description' | 'videos' | 'pictures' | 'duration' | 'rest'>
|
|
|
+ & { format: Pick<Format, 'name' | 'description'>, exercises: Maybe<Array<(
|
|
|
+ Pick<ExerciseInstance, 'order' | 'repetitions' | 'variation'>
|
|
|
+ & { exercise: DisplayExerciseFragment }
|
|
|
+ )>> }
|
|
|
+);
|
|
|
+
|
|
|
+export type DisplayExerciseInstanceFragment = (
|
|
|
+ Pick<ExerciseInstance, 'id' | 'order' | 'repetitions' | 'variation'>
|
|
|
+ & { exercise: DisplayExerciseFragment }
|
|
|
+);
|
|
|
+
|
|
|
+export type DisplayExerciseFragment = Pick<Exercise, 'id' | 'name' | 'description' | 'videos' | 'pictures' | 'targets' | 'baseExercise'>;
|
|
|
+
|
|
|
+export type PublishedTrainingsQueryVariables = {};
|
|
|
+
|
|
|
+
|
|
|
+export type PublishedTrainingsQuery = { publishedTrainings: Array<DisplayTrainingFragment> };
|
|
|
+
|
|
|
export type TrainingsQueryVariables = {};
|
|
|
|
|
|
|
|
@@ -3370,6 +3457,16 @@ export type FormatsQueryVariables = {};
|
|
|
|
|
|
export type FormatsQuery = { formats: Array<Pick<Format, 'id' | 'name' | 'description'>> };
|
|
|
|
|
|
+export type BlocksQueryVariables = {};
|
|
|
+
|
|
|
+
|
|
|
+export type BlocksQuery = { blocks: Array<BlockContentFragment> };
|
|
|
+
|
|
|
+export type ExercisesQueryVariables = {};
|
|
|
+
|
|
|
+
|
|
|
+export type ExercisesQuery = { exercises: Array<ExerciseContentFragment> };
|
|
|
+
|
|
|
export type CreateTrainingMutationVariables = {
|
|
|
title: Scalars['String'],
|
|
|
type: TrainingTypeCreateOneInput,
|
|
@@ -3477,20 +3574,14 @@ export type UserUpdateMutationVariables = {
|
|
|
export type UserUpdateMutation = { updateUser: Maybe<Pick<User, 'id' | 'name' | 'email' | 'permissions' | 'interests'>> };
|
|
|
|
|
|
export const ExerciseContentFragmentDoc = gql`
|
|
|
- fragment exerciseContent on ExerciseInstance {
|
|
|
+ fragment exerciseContent on Exercise {
|
|
|
id
|
|
|
- exercise {
|
|
|
- id
|
|
|
- name
|
|
|
- description
|
|
|
- videos
|
|
|
- pictures
|
|
|
- targets
|
|
|
- baseExercise
|
|
|
- }
|
|
|
- order
|
|
|
- repetitions
|
|
|
- variation
|
|
|
+ name
|
|
|
+ description
|
|
|
+ videos
|
|
|
+ pictures
|
|
|
+ targets
|
|
|
+ baseExercise
|
|
|
}
|
|
|
`;
|
|
|
export const BlockHintFragmentDoc = gql`
|
|
@@ -3511,7 +3602,13 @@ export const BlockHintFragmentDoc = gql`
|
|
|
id
|
|
|
}
|
|
|
exercises {
|
|
|
- ...exerciseContent
|
|
|
+ id
|
|
|
+ exercise {
|
|
|
+ ...exerciseContent
|
|
|
+ }
|
|
|
+ order
|
|
|
+ repetitions
|
|
|
+ variation
|
|
|
}
|
|
|
}
|
|
|
${ExerciseContentFragmentDoc}`;
|
|
@@ -3539,7 +3636,13 @@ export const BlockContentFragmentDoc = gql`
|
|
|
variation
|
|
|
}
|
|
|
exercises {
|
|
|
- ...exerciseContent
|
|
|
+ id
|
|
|
+ exercise {
|
|
|
+ ...exerciseContent
|
|
|
+ }
|
|
|
+ order
|
|
|
+ repetitions
|
|
|
+ variation
|
|
|
}
|
|
|
}
|
|
|
${BlockHintFragmentDoc}
|
|
@@ -3566,6 +3669,98 @@ export const SubBlockHintFragmentDoc = gql`
|
|
|
variation
|
|
|
}
|
|
|
${BlockHintFragmentDoc}`;
|
|
|
+export const DisplayBlockInstanceFragmentDoc = gql`
|
|
|
+ fragment displayBlockInstance on BlockInstance {
|
|
|
+ id
|
|
|
+ order
|
|
|
+ rounds
|
|
|
+ variation
|
|
|
+}
|
|
|
+ `;
|
|
|
+export const DisplayExerciseFragmentDoc = gql`
|
|
|
+ fragment displayExercise on Exercise {
|
|
|
+ id
|
|
|
+ name
|
|
|
+ description
|
|
|
+ videos
|
|
|
+ pictures
|
|
|
+ targets
|
|
|
+ baseExercise
|
|
|
+}
|
|
|
+ `;
|
|
|
+export const DisplayBlockFragmentDoc = gql`
|
|
|
+ fragment displayBlock on Block {
|
|
|
+ id
|
|
|
+ title
|
|
|
+ description
|
|
|
+ videos
|
|
|
+ pictures
|
|
|
+ duration
|
|
|
+ format {
|
|
|
+ name
|
|
|
+ description
|
|
|
+ }
|
|
|
+ rest
|
|
|
+ exercises {
|
|
|
+ order
|
|
|
+ repetitions
|
|
|
+ variation
|
|
|
+ exercise {
|
|
|
+ ...displayExercise
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+ ${DisplayExerciseFragmentDoc}`;
|
|
|
+export const DisplayTrainingFragmentDoc = gql`
|
|
|
+ fragment displayTraining on Training {
|
|
|
+ id
|
|
|
+ title
|
|
|
+ type {
|
|
|
+ id
|
|
|
+ name
|
|
|
+ description
|
|
|
+ }
|
|
|
+ trainingDate
|
|
|
+ location
|
|
|
+ attendance
|
|
|
+ blocks {
|
|
|
+ ...displayBlockInstance
|
|
|
+ block {
|
|
|
+ ...displayBlock
|
|
|
+ blocks {
|
|
|
+ ...displayBlockInstance
|
|
|
+ block {
|
|
|
+ ...displayBlock
|
|
|
+ blocks {
|
|
|
+ ...displayBlockInstance
|
|
|
+ block {
|
|
|
+ ...displayBlock
|
|
|
+ blocks {
|
|
|
+ id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ registrations {
|
|
|
+ id
|
|
|
+ }
|
|
|
+}
|
|
|
+ ${DisplayBlockInstanceFragmentDoc}
|
|
|
+${DisplayBlockFragmentDoc}`;
|
|
|
+export const DisplayExerciseInstanceFragmentDoc = gql`
|
|
|
+ fragment displayExerciseInstance on ExerciseInstance {
|
|
|
+ id
|
|
|
+ order
|
|
|
+ repetitions
|
|
|
+ variation
|
|
|
+ exercise {
|
|
|
+ ...displayExercise
|
|
|
+ }
|
|
|
+}
|
|
|
+ ${DisplayExerciseFragmentDoc}`;
|
|
|
export const TrainingDocument = gql`
|
|
|
query training($id: ID!) {
|
|
|
training(id: $id) {
|
|
@@ -3617,6 +3812,38 @@ export function useTrainingLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHoo
|
|
|
export type TrainingQueryHookResult = ReturnType<typeof useTrainingQuery>;
|
|
|
export type TrainingLazyQueryHookResult = ReturnType<typeof useTrainingLazyQuery>;
|
|
|
export type TrainingQueryResult = ApolloReactCommon.QueryResult<TrainingQuery, TrainingQueryVariables>;
|
|
|
+export const PublishedTrainingsDocument = gql`
|
|
|
+ query publishedTrainings {
|
|
|
+ publishedTrainings {
|
|
|
+ ...displayTraining
|
|
|
+ }
|
|
|
+}
|
|
|
+ ${DisplayTrainingFragmentDoc}`;
|
|
|
+
|
|
|
+/**
|
|
|
+ * __usePublishedTrainingsQuery__
|
|
|
+ *
|
|
|
+ * To run a query within a React component, call `usePublishedTrainingsQuery` and pass it any options that fit your needs.
|
|
|
+ * When your component renders, `usePublishedTrainingsQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
|
+ * you can use to render your UI.
|
|
|
+ *
|
|
|
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
|
+ *
|
|
|
+ * @example
|
|
|
+ * const { data, loading, error } = usePublishedTrainingsQuery({
|
|
|
+ * variables: {
|
|
|
+ * },
|
|
|
+ * });
|
|
|
+ */
|
|
|
+export function usePublishedTrainingsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<PublishedTrainingsQuery, PublishedTrainingsQueryVariables>) {
|
|
|
+ return ApolloReactHooks.useQuery<PublishedTrainingsQuery, PublishedTrainingsQueryVariables>(PublishedTrainingsDocument, baseOptions);
|
|
|
+ }
|
|
|
+export function usePublishedTrainingsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<PublishedTrainingsQuery, PublishedTrainingsQueryVariables>) {
|
|
|
+ return ApolloReactHooks.useLazyQuery<PublishedTrainingsQuery, PublishedTrainingsQueryVariables>(PublishedTrainingsDocument, baseOptions);
|
|
|
+ }
|
|
|
+export type PublishedTrainingsQueryHookResult = ReturnType<typeof usePublishedTrainingsQuery>;
|
|
|
+export type PublishedTrainingsLazyQueryHookResult = ReturnType<typeof usePublishedTrainingsLazyQuery>;
|
|
|
+export type PublishedTrainingsQueryResult = ApolloReactCommon.QueryResult<PublishedTrainingsQuery, PublishedTrainingsQueryVariables>;
|
|
|
export const TrainingsDocument = gql`
|
|
|
query trainings {
|
|
|
trainings {
|
|
@@ -3734,6 +3961,70 @@ export function useFormatsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHook
|
|
|
export type FormatsQueryHookResult = ReturnType<typeof useFormatsQuery>;
|
|
|
export type FormatsLazyQueryHookResult = ReturnType<typeof useFormatsLazyQuery>;
|
|
|
export type FormatsQueryResult = ApolloReactCommon.QueryResult<FormatsQuery, FormatsQueryVariables>;
|
|
|
+export const BlocksDocument = gql`
|
|
|
+ query blocks {
|
|
|
+ blocks {
|
|
|
+ ...blockContent
|
|
|
+ }
|
|
|
+}
|
|
|
+ ${BlockContentFragmentDoc}`;
|
|
|
+
|
|
|
+/**
|
|
|
+ * __useBlocksQuery__
|
|
|
+ *
|
|
|
+ * To run a query within a React component, call `useBlocksQuery` and pass it any options that fit your needs.
|
|
|
+ * When your component renders, `useBlocksQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
|
+ * you can use to render your UI.
|
|
|
+ *
|
|
|
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
|
+ *
|
|
|
+ * @example
|
|
|
+ * const { data, loading, error } = useBlocksQuery({
|
|
|
+ * variables: {
|
|
|
+ * },
|
|
|
+ * });
|
|
|
+ */
|
|
|
+export function useBlocksQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<BlocksQuery, BlocksQueryVariables>) {
|
|
|
+ return ApolloReactHooks.useQuery<BlocksQuery, BlocksQueryVariables>(BlocksDocument, baseOptions);
|
|
|
+ }
|
|
|
+export function useBlocksLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<BlocksQuery, BlocksQueryVariables>) {
|
|
|
+ return ApolloReactHooks.useLazyQuery<BlocksQuery, BlocksQueryVariables>(BlocksDocument, baseOptions);
|
|
|
+ }
|
|
|
+export type BlocksQueryHookResult = ReturnType<typeof useBlocksQuery>;
|
|
|
+export type BlocksLazyQueryHookResult = ReturnType<typeof useBlocksLazyQuery>;
|
|
|
+export type BlocksQueryResult = ApolloReactCommon.QueryResult<BlocksQuery, BlocksQueryVariables>;
|
|
|
+export const ExercisesDocument = gql`
|
|
|
+ query exercises {
|
|
|
+ exercises {
|
|
|
+ ...exerciseContent
|
|
|
+ }
|
|
|
+}
|
|
|
+ ${ExerciseContentFragmentDoc}`;
|
|
|
+
|
|
|
+/**
|
|
|
+ * __useExercisesQuery__
|
|
|
+ *
|
|
|
+ * To run a query within a React component, call `useExercisesQuery` and pass it any options that fit your needs.
|
|
|
+ * When your component renders, `useExercisesQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
|
+ * you can use to render your UI.
|
|
|
+ *
|
|
|
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
|
+ *
|
|
|
+ * @example
|
|
|
+ * const { data, loading, error } = useExercisesQuery({
|
|
|
+ * variables: {
|
|
|
+ * },
|
|
|
+ * });
|
|
|
+ */
|
|
|
+export function useExercisesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<ExercisesQuery, ExercisesQueryVariables>) {
|
|
|
+ return ApolloReactHooks.useQuery<ExercisesQuery, ExercisesQueryVariables>(ExercisesDocument, baseOptions);
|
|
|
+ }
|
|
|
+export function useExercisesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<ExercisesQuery, ExercisesQueryVariables>) {
|
|
|
+ return ApolloReactHooks.useLazyQuery<ExercisesQuery, ExercisesQueryVariables>(ExercisesDocument, baseOptions);
|
|
|
+ }
|
|
|
+export type ExercisesQueryHookResult = ReturnType<typeof useExercisesQuery>;
|
|
|
+export type ExercisesLazyQueryHookResult = ReturnType<typeof useExercisesLazyQuery>;
|
|
|
+export type ExercisesQueryResult = ApolloReactCommon.QueryResult<ExercisesQuery, ExercisesQueryVariables>;
|
|
|
export const CreateTrainingDocument = gql`
|
|
|
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) {
|