Skip to content

Commit

Permalink
feat(core): Implement productVariants list query in Admin API
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Feb 10, 2021
1 parent 8975247 commit 6d830a0
Show file tree
Hide file tree
Showing 10 changed files with 246 additions and 192 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export type Query = {
/** Get a Product either by id or slug. If neither id nor slug is speicified, an error will result. */
product?: Maybe<Product>;
/** Get a ProductVariant by id */
productVariants: ProductVariantList;
/** Get a ProductVariant by id */
productVariant?: Maybe<ProductVariant>;
promotion?: Maybe<Promotion>;
promotions: PromotionList;
Expand Down Expand Up @@ -188,6 +190,10 @@ export type QueryProductArgs = {
slug?: Maybe<Scalars['String']>;
};

export type QueryProductVariantsArgs = {
options?: Maybe<ProductVariantListOptions>;
};

export type QueryProductVariantArgs = {
id: Scalars['ID'];
};
Expand Down Expand Up @@ -3948,6 +3954,13 @@ export type ProductListOptions = {
filter?: Maybe<ProductFilterParameter>;
};

export type ProductVariantListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
sort?: Maybe<ProductVariantSortParameter>;
filter?: Maybe<ProductVariantFilterParameter>;
};

export type PromotionListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
Expand Down Expand Up @@ -3976,13 +3989,6 @@ export type TaxRateListOptions = {
filter?: Maybe<TaxRateFilterParameter>;
};

export type ProductVariantListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
sort?: Maybe<ProductVariantSortParameter>;
filter?: Maybe<ProductVariantFilterParameter>;
};

export type HistoryEntryListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
Expand Down Expand Up @@ -4209,6 +4215,38 @@ export type ProductSortParameter = {
description?: Maybe<SortOrder>;
};

export type ProductVariantFilterParameter = {
enabled?: Maybe<BooleanOperators>;
trackInventory?: Maybe<StringOperators>;
stockOnHand?: Maybe<NumberOperators>;
stockAllocated?: Maybe<NumberOperators>;
outOfStockThreshold?: Maybe<NumberOperators>;
useGlobalOutOfStockThreshold?: Maybe<BooleanOperators>;
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
languageCode?: Maybe<StringOperators>;
sku?: Maybe<StringOperators>;
name?: Maybe<StringOperators>;
price?: Maybe<NumberOperators>;
currencyCode?: Maybe<StringOperators>;
priceIncludesTax?: Maybe<BooleanOperators>;
priceWithTax?: Maybe<NumberOperators>;
};

export type ProductVariantSortParameter = {
stockOnHand?: Maybe<SortOrder>;
stockAllocated?: Maybe<SortOrder>;
outOfStockThreshold?: Maybe<SortOrder>;
id?: Maybe<SortOrder>;
productId?: Maybe<SortOrder>;
createdAt?: Maybe<SortOrder>;
updatedAt?: Maybe<SortOrder>;
sku?: Maybe<SortOrder>;
name?: Maybe<SortOrder>;
price?: Maybe<SortOrder>;
priceWithTax?: Maybe<SortOrder>;
};

export type PromotionFilterParameter = {
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
Expand Down Expand Up @@ -4281,38 +4319,6 @@ export type TaxRateSortParameter = {
value?: Maybe<SortOrder>;
};

export type ProductVariantFilterParameter = {
enabled?: Maybe<BooleanOperators>;
trackInventory?: Maybe<StringOperators>;
stockOnHand?: Maybe<NumberOperators>;
stockAllocated?: Maybe<NumberOperators>;
outOfStockThreshold?: Maybe<NumberOperators>;
useGlobalOutOfStockThreshold?: Maybe<BooleanOperators>;
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
languageCode?: Maybe<StringOperators>;
sku?: Maybe<StringOperators>;
name?: Maybe<StringOperators>;
price?: Maybe<NumberOperators>;
currencyCode?: Maybe<StringOperators>;
priceIncludesTax?: Maybe<BooleanOperators>;
priceWithTax?: Maybe<NumberOperators>;
};

export type ProductVariantSortParameter = {
stockOnHand?: Maybe<SortOrder>;
stockAllocated?: Maybe<SortOrder>;
outOfStockThreshold?: Maybe<SortOrder>;
id?: Maybe<SortOrder>;
productId?: Maybe<SortOrder>;
createdAt?: Maybe<SortOrder>;
updatedAt?: Maybe<SortOrder>;
sku?: Maybe<SortOrder>;
name?: Maybe<SortOrder>;
price?: Maybe<SortOrder>;
priceWithTax?: Maybe<SortOrder>;
};

export type HistoryEntryFilterParameter = {
isPublic?: Maybe<BooleanOperators>;
createdAt?: Maybe<DateOperators>;
Expand Down
85 changes: 46 additions & 39 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export type Query = {
/** Get a Product either by id or slug. If neither id nor slug is speicified, an error will result. */
product?: Maybe<Product>;
/** Get a ProductVariant by id */
productVariants: ProductVariantList;
/** Get a ProductVariant by id */
productVariant?: Maybe<ProductVariant>;
promotion?: Maybe<Promotion>;
promotions: PromotionList;
Expand Down Expand Up @@ -217,6 +219,11 @@ export type QueryProductArgs = {
};


export type QueryProductVariantsArgs = {
options?: Maybe<ProductVariantListOptions>;
};


export type QueryProductVariantArgs = {
id: Scalars['ID'];
};
Expand Down Expand Up @@ -4186,6 +4193,13 @@ export type ProductListOptions = {
filter?: Maybe<ProductFilterParameter>;
};

export type ProductVariantListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
sort?: Maybe<ProductVariantSortParameter>;
filter?: Maybe<ProductVariantFilterParameter>;
};

export type PromotionListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
Expand Down Expand Up @@ -4214,13 +4228,6 @@ export type TaxRateListOptions = {
filter?: Maybe<TaxRateFilterParameter>;
};

export type ProductVariantListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
sort?: Maybe<ProductVariantSortParameter>;
filter?: Maybe<ProductVariantFilterParameter>;
};

export type HistoryEntryListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
Expand Down Expand Up @@ -4447,6 +4454,38 @@ export type ProductSortParameter = {
description?: Maybe<SortOrder>;
};

export type ProductVariantFilterParameter = {
enabled?: Maybe<BooleanOperators>;
trackInventory?: Maybe<StringOperators>;
stockOnHand?: Maybe<NumberOperators>;
stockAllocated?: Maybe<NumberOperators>;
outOfStockThreshold?: Maybe<NumberOperators>;
useGlobalOutOfStockThreshold?: Maybe<BooleanOperators>;
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
languageCode?: Maybe<StringOperators>;
sku?: Maybe<StringOperators>;
name?: Maybe<StringOperators>;
price?: Maybe<NumberOperators>;
currencyCode?: Maybe<StringOperators>;
priceIncludesTax?: Maybe<BooleanOperators>;
priceWithTax?: Maybe<NumberOperators>;
};

export type ProductVariantSortParameter = {
stockOnHand?: Maybe<SortOrder>;
stockAllocated?: Maybe<SortOrder>;
outOfStockThreshold?: Maybe<SortOrder>;
id?: Maybe<SortOrder>;
productId?: Maybe<SortOrder>;
createdAt?: Maybe<SortOrder>;
updatedAt?: Maybe<SortOrder>;
sku?: Maybe<SortOrder>;
name?: Maybe<SortOrder>;
price?: Maybe<SortOrder>;
priceWithTax?: Maybe<SortOrder>;
};

export type PromotionFilterParameter = {
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
Expand Down Expand Up @@ -4519,38 +4558,6 @@ export type TaxRateSortParameter = {
value?: Maybe<SortOrder>;
};

export type ProductVariantFilterParameter = {
enabled?: Maybe<BooleanOperators>;
trackInventory?: Maybe<StringOperators>;
stockOnHand?: Maybe<NumberOperators>;
stockAllocated?: Maybe<NumberOperators>;
outOfStockThreshold?: Maybe<NumberOperators>;
useGlobalOutOfStockThreshold?: Maybe<BooleanOperators>;
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
languageCode?: Maybe<StringOperators>;
sku?: Maybe<StringOperators>;
name?: Maybe<StringOperators>;
price?: Maybe<NumberOperators>;
currencyCode?: Maybe<StringOperators>;
priceIncludesTax?: Maybe<BooleanOperators>;
priceWithTax?: Maybe<NumberOperators>;
};

export type ProductVariantSortParameter = {
stockOnHand?: Maybe<SortOrder>;
stockAllocated?: Maybe<SortOrder>;
outOfStockThreshold?: Maybe<SortOrder>;
id?: Maybe<SortOrder>;
productId?: Maybe<SortOrder>;
createdAt?: Maybe<SortOrder>;
updatedAt?: Maybe<SortOrder>;
sku?: Maybe<SortOrder>;
name?: Maybe<SortOrder>;
price?: Maybe<SortOrder>;
priceWithTax?: Maybe<SortOrder>;
};

export type HistoryEntryFilterParameter = {
isPublic?: Maybe<BooleanOperators>;
createdAt?: Maybe<DateOperators>;
Expand Down
Loading

0 comments on commit 6d830a0

Please sign in to comment.