|
@@ -15,6 +15,10 @@ export type Scalars = {
|
|
|
Upload: any,
|
|
|
};
|
|
|
|
|
|
+export type AggregateTraining = {
|
|
|
+ count: Scalars['Int'],
|
|
|
+};
|
|
|
+
|
|
|
export type Block = Node & {
|
|
|
id: Scalars['ID'],
|
|
|
title: Scalars['String'],
|
|
@@ -1634,6 +1638,18 @@ export type Node = {
|
|
|
id: Scalars['ID'],
|
|
|
};
|
|
|
|
|
|
+/** Information about pagination in a connection. */
|
|
|
+export type PageInfo = {
|
|
|
+ /** When paginating forwards, are there more items? */
|
|
|
+ hasNextPage: Scalars['Boolean'],
|
|
|
+ /** When paginating backwards, are there more items? */
|
|
|
+ hasPreviousPage: Scalars['Boolean'],
|
|
|
+ /** When paginating backwards, the cursor to continue. */
|
|
|
+ startCursor?: Maybe<Scalars['String']>,
|
|
|
+ /** When paginating forwards, the cursor to continue. */
|
|
|
+ endCursor?: Maybe<Scalars['String']>,
|
|
|
+};
|
|
|
+
|
|
|
export enum Permission {
|
|
|
Admin = 'ADMIN',
|
|
|
Instructor = 'INSTRUCTOR'
|
|
@@ -1648,6 +1664,7 @@ export type Query = {
|
|
|
training?: Maybe<Training>,
|
|
|
trainings: Array<Training>,
|
|
|
publishedTrainings: Array<Training>,
|
|
|
+ trainingsCount: TrainingConnection,
|
|
|
trainingType?: Maybe<TrainingType>,
|
|
|
trainingTypes: Array<TrainingType>,
|
|
|
block?: Maybe<Block>,
|
|
@@ -1696,6 +1713,11 @@ export type QueryTrainingsArgs = {
|
|
|
};
|
|
|
|
|
|
|
|
|
+export type QueryTrainingsCountArgs = {
|
|
|
+ where?: Maybe<TrainingWhereInput>
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
export type QueryTrainingTypeArgs = {
|
|
|
where: TrainingTypeWhereUniqueInput
|
|
|
};
|
|
@@ -2450,6 +2472,15 @@ export type TrainingBlocksArgs = {
|
|
|
last?: Maybe<Scalars['Int']>
|
|
|
};
|
|
|
|
|
|
+/** A connection to a list of items. */
|
|
|
+export type TrainingConnection = {
|
|
|
+ /** Information to aid in pagination. */
|
|
|
+ pageInfo: PageInfo,
|
|
|
+ /** A list of edges. */
|
|
|
+ edges: Array<Maybe<TrainingEdge>>,
|
|
|
+ aggregate: AggregateTraining,
|
|
|
+};
|
|
|
+
|
|
|
export type TrainingCreateOneWithoutBlocksInput = {
|
|
|
create?: Maybe<TrainingCreateWithoutBlocksInput>,
|
|
|
connect?: Maybe<TrainingWhereUniqueInput>,
|
|
@@ -2467,6 +2498,14 @@ export type TrainingCreateWithoutBlocksInput = {
|
|
|
ratings?: Maybe<RatingCreateManyInput>,
|
|
|
};
|
|
|
|
|
|
+/** An edge in a connection. */
|
|
|
+export type TrainingEdge = {
|
|
|
+ /** The item at the end of the edge. */
|
|
|
+ node: Training,
|
|
|
+ /** A cursor for use in pagination. */
|
|
|
+ cursor: Scalars['String'],
|
|
|
+};
|
|
|
+
|
|
|
export enum TrainingOrderByInput {
|
|
|
IdAsc = 'id_ASC',
|
|
|
IdDesc = 'id_DESC',
|
|
@@ -3442,10 +3481,18 @@ export type PublishedTrainingsQueryVariables = {};
|
|
|
|
|
|
export type PublishedTrainingsQuery = { publishedTrainings: Array<DisplayTrainingFragment> };
|
|
|
|
|
|
-export type TrainingsQueryVariables = {};
|
|
|
+export type TrainingsQueryVariables = {
|
|
|
+ where?: Maybe<TrainingWhereInput>,
|
|
|
+ orderBy?: Maybe<TrainingOrderByInput>,
|
|
|
+ skip?: Maybe<Scalars['Int']>,
|
|
|
+ after?: Maybe<Scalars['String']>,
|
|
|
+ before?: Maybe<Scalars['String']>,
|
|
|
+ first?: Maybe<Scalars['Int']>,
|
|
|
+ last?: Maybe<Scalars['Int']>
|
|
|
+};
|
|
|
|
|
|
|
|
|
-export type TrainingsQuery = { trainings: Array<(
|
|
|
+export type TrainingsQuery = { count: { aggregate: Pick<AggregateTraining, 'count'> }, trainings: Array<(
|
|
|
Pick<Training, 'id' | 'title' | 'trainingDate' | 'location' | 'attendance' | 'published'>
|
|
|
& { type: Pick<TrainingType, 'id' | 'name' | 'description'>, blocks: Maybe<Array<(
|
|
|
{ block: (
|
|
@@ -3848,8 +3895,13 @@ export type PublishedTrainingsQueryHookResult = ReturnType<typeof usePublishedTr
|
|
|
export type PublishedTrainingsLazyQueryHookResult = ReturnType<typeof usePublishedTrainingsLazyQuery>;
|
|
|
export type PublishedTrainingsQueryResult = ApolloReactCommon.QueryResult<PublishedTrainingsQuery, PublishedTrainingsQueryVariables>;
|
|
|
export const TrainingsDocument = gql`
|
|
|
- query trainings {
|
|
|
- trainings {
|
|
|
+ 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) {
|
|
|
id
|
|
|
title
|
|
|
type {
|
|
@@ -3900,6 +3952,13 @@ ${BlockWithoutBlocksFragmentDoc}`;
|
|
|
* @example
|
|
|
* const { data, loading, error } = useTrainingsQuery({
|
|
|
* variables: {
|
|
|
+ * where: // value for 'where'
|
|
|
+ * orderBy: // value for 'orderBy'
|
|
|
+ * skip: // value for 'skip'
|
|
|
+ * after: // value for 'after'
|
|
|
+ * before: // value for 'before'
|
|
|
+ * first: // value for 'first'
|
|
|
+ * last: // value for 'last'
|
|
|
* },
|
|
|
* });
|
|
|
*/
|