Skip to content

Commit

Permalink
feat(core): Channels mutation now returns PaginatedList
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The `channels` mutation now returns a PaginatedList rather than
a simple array of Channels.
  • Loading branch information
michaelbromley committed May 1, 2023
1 parent f29aae9 commit d7a3447
Show file tree
Hide file tree
Showing 9 changed files with 8,913 additions and 4,989 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,44 @@ export type ChannelDefaultLanguageError = ErrorResult & {
message: Scalars['String'];
};

export type ChannelFilterParameter = {
code?: InputMaybe<StringOperators>;
createdAt?: InputMaybe<DateOperators>;
currencyCode?: InputMaybe<StringOperators>;
defaultCurrencyCode?: InputMaybe<StringOperators>;
defaultLanguageCode?: InputMaybe<StringOperators>;
id?: InputMaybe<IdOperators>;
pricesIncludeTax?: InputMaybe<BooleanOperators>;
token?: InputMaybe<StringOperators>;
updatedAt?: InputMaybe<DateOperators>;
};

export type ChannelList = PaginatedList & {
items: Array<Channel>;
totalItems: Scalars['Int'];
};

export type ChannelListOptions = {
/** Allows the results to be filtered */
filter?: InputMaybe<ChannelFilterParameter>;
/** Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. */
filterOperator?: InputMaybe<LogicalOperator>;
/** Skips the first n results, for use in pagination */
skip?: InputMaybe<Scalars['Int']>;
/** Specifies which properties to sort the results by */
sort?: InputMaybe<ChannelSortParameter>;
/** Takes n results, for use in pagination */
take?: InputMaybe<Scalars['Int']>;
};

export type ChannelSortParameter = {
code?: InputMaybe<SortOrder>;
createdAt?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
token?: InputMaybe<SortOrder>;
updatedAt?: InputMaybe<SortOrder>;
};

export type Collection = Node & {
assets: Array<Asset>;
breadcrumbs: Array<CollectionBreadcrumb>;
Expand Down Expand Up @@ -4383,7 +4421,7 @@ export type Query = {
/** Get a list of Assets */
assets: AssetList;
channel?: Maybe<Channel>;
channels: Array<Channel>;
channels: ChannelList;
/** Get a Collection either by id or slug. If neither id nor slug is specified, an error will result. */
collection?: Maybe<Collection>;
collectionFilters: Array<ConfigurableOperationDefinition>;
Expand Down Expand Up @@ -4475,6 +4513,10 @@ export type QueryChannelArgs = {
id: Scalars['ID'];
};

export type QueryChannelsArgs = {
options?: InputMaybe<ChannelListOptions>;
};

export type QueryCollectionArgs = {
id?: InputMaybe<Scalars['ID']>;
slug?: InputMaybe<Scalars['String']>;
Expand Down
46 changes: 45 additions & 1 deletion packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,45 @@ export type ChannelDefaultLanguageError = ErrorResult & {
message: Scalars['String'];
};

export type ChannelFilterParameter = {
code?: InputMaybe<StringOperators>;
createdAt?: InputMaybe<DateOperators>;
currencyCode?: InputMaybe<StringOperators>;
defaultCurrencyCode?: InputMaybe<StringOperators>;
defaultLanguageCode?: InputMaybe<StringOperators>;
id?: InputMaybe<IdOperators>;
pricesIncludeTax?: InputMaybe<BooleanOperators>;
token?: InputMaybe<StringOperators>;
updatedAt?: InputMaybe<DateOperators>;
};

export type ChannelList = PaginatedList & {
__typename?: 'ChannelList';
items: Array<Channel>;
totalItems: Scalars['Int'];
};

export type ChannelListOptions = {
/** Allows the results to be filtered */
filter?: InputMaybe<ChannelFilterParameter>;
/** Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. */
filterOperator?: InputMaybe<LogicalOperator>;
/** Skips the first n results, for use in pagination */
skip?: InputMaybe<Scalars['Int']>;
/** Specifies which properties to sort the results by */
sort?: InputMaybe<ChannelSortParameter>;
/** Takes n results, for use in pagination */
take?: InputMaybe<Scalars['Int']>;
};

export type ChannelSortParameter = {
code?: InputMaybe<SortOrder>;
createdAt?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
token?: InputMaybe<SortOrder>;
updatedAt?: InputMaybe<SortOrder>;
};

export type Collection = Node & {
__typename?: 'Collection';
assets: Array<Asset>;
Expand Down Expand Up @@ -4611,7 +4650,7 @@ export type Query = {
/** Get a list of Assets */
assets: AssetList;
channel?: Maybe<Channel>;
channels: Array<Channel>;
channels: ChannelList;
/** Get a Collection either by id or slug. If neither id nor slug is specified, an error will result. */
collection?: Maybe<Collection>;
collectionFilters: Array<ConfigurableOperationDefinition>;
Expand Down Expand Up @@ -4709,6 +4748,11 @@ export type QueryChannelArgs = {
};


export type QueryChannelsArgs = {
options?: InputMaybe<ChannelListOptions>;
};


export type QueryCollectionArgs = {
id?: InputMaybe<Scalars['ID']>;
slug?: InputMaybe<Scalars['String']>;
Expand Down
Loading

0 comments on commit d7a3447

Please sign in to comment.