Skip to content

Commit

Permalink
feat(core): Allow product to be queried by slug
Browse files Browse the repository at this point in the history
Closes #108
  • Loading branch information
michaelbromley committed May 31, 2019
1 parent 2cecb39 commit a2d847d
Show file tree
Hide file tree
Showing 17 changed files with 310 additions and 166 deletions.
85 changes: 43 additions & 42 deletions admin-ui/src/app/common/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1416,16 +1416,16 @@ export type Mutation = {
createAssets: Array<Asset>,
login: LoginResult,
logout: Scalars['Boolean'],
/** Create a new Channel */
createChannel: Channel,
/** Update an existing Channel */
updateChannel: Channel,
/** Create a new Collection */
createCollection: Collection,
/** Update an existing Collection */
updateCollection: Collection,
/** Move a Collection to a different parent or index */
moveCollection: Collection,
/** Create a new Channel */
createChannel: Channel,
/** Update an existing Channel */
updateChannel: Channel,
/** Create a new Country */
createCountry: Country,
/** Update an existing Country */
Expand Down Expand Up @@ -1498,14 +1498,14 @@ export type Mutation = {
createShippingMethod: ShippingMethod,
/** Update an existing ShippingMethod */
updateShippingMethod: ShippingMethod,
/** Create a new TaxRate */
createTaxRate: TaxRate,
/** Update an existing TaxRate */
updateTaxRate: TaxRate,
/** Create a new TaxCategory */
createTaxCategory: TaxCategory,
/** Update an existing TaxCategory */
updateTaxCategory: TaxCategory,
/** Create a new TaxRate */
createTaxRate: TaxRate,
/** Update an existing TaxRate */
updateTaxRate: TaxRate,
/** Create a new Zone */
createZone: Zone,
/** Update an existing Zone */
Expand Down Expand Up @@ -1552,16 +1552,6 @@ export type MutationLoginArgs = {
};


export type MutationCreateChannelArgs = {
input: CreateChannelInput
};


export type MutationUpdateChannelArgs = {
input: UpdateChannelInput
};


export type MutationCreateCollectionArgs = {
input: CreateCollectionInput
};
Expand All @@ -1577,6 +1567,16 @@ export type MutationMoveCollectionArgs = {
};


export type MutationCreateChannelArgs = {
input: CreateChannelInput
};


export type MutationUpdateChannelArgs = {
input: UpdateChannelInput
};


export type MutationCreateCountryArgs = {
input: CreateCountryInput
};
Expand Down Expand Up @@ -1778,23 +1778,23 @@ export type MutationUpdateShippingMethodArgs = {
};


export type MutationCreateTaxRateArgs = {
input: CreateTaxRateInput
export type MutationCreateTaxCategoryArgs = {
input: CreateTaxCategoryInput
};


export type MutationUpdateTaxRateArgs = {
input: UpdateTaxRateInput
export type MutationUpdateTaxCategoryArgs = {
input: UpdateTaxCategoryInput
};


export type MutationCreateTaxCategoryArgs = {
input: CreateTaxCategoryInput
export type MutationCreateTaxRateArgs = {
input: CreateTaxRateInput
};


export type MutationUpdateTaxCategoryArgs = {
input: UpdateTaxCategoryInput
export type MutationUpdateTaxRateArgs = {
input: UpdateTaxRateInput
};


Expand Down Expand Up @@ -2298,12 +2298,12 @@ export type Query = {
assets: AssetList,
asset?: Maybe<Asset>,
me?: Maybe<CurrentUser>,
channels: Array<Channel>,
channel?: Maybe<Channel>,
activeChannel: Channel,
collections: CollectionList,
collection?: Maybe<Collection>,
collectionFilters: Array<ConfigurableOperation>,
channels: Array<Channel>,
channel?: Maybe<Channel>,
activeChannel: Channel,
countries: CountryList,
country?: Maybe<Country>,
customerGroups: Array<CustomerGroup>,
Expand Down Expand Up @@ -2331,10 +2331,10 @@ export type Query = {
shippingMethod?: Maybe<ShippingMethod>,
shippingEligibilityCheckers: Array<ConfigurableOperation>,
shippingCalculators: Array<ConfigurableOperation>,
taxRates: TaxRateList,
taxRate?: Maybe<TaxRate>,
taxCategories: Array<TaxCategory>,
taxCategory?: Maybe<TaxCategory>,
taxRates: TaxRateList,
taxRate?: Maybe<TaxRate>,
zones: Array<Zone>,
zone?: Maybe<Zone>,
temp__?: Maybe<Scalars['Boolean']>,
Expand Down Expand Up @@ -2364,11 +2364,6 @@ export type QueryAssetArgs = {
};


export type QueryChannelArgs = {
id: Scalars['ID']
};


export type QueryCollectionsArgs = {
languageCode?: Maybe<LanguageCode>,
options?: Maybe<CollectionListOptions>
Expand All @@ -2381,6 +2376,11 @@ export type QueryCollectionArgs = {
};


export type QueryChannelArgs = {
id: Scalars['ID']
};


export type QueryCountriesArgs = {
options?: Maybe<CountryListOptions>
};
Expand Down Expand Up @@ -2462,7 +2462,8 @@ export type QueryProductsArgs = {


export type QueryProductArgs = {
id: Scalars['ID'],
id?: Maybe<Scalars['ID']>,
slug?: Maybe<Scalars['String']>,
languageCode?: Maybe<LanguageCode>
};

Expand Down Expand Up @@ -2497,17 +2498,17 @@ export type QueryShippingMethodArgs = {
};


export type QueryTaxRatesArgs = {
options?: Maybe<TaxRateListOptions>
export type QueryTaxCategoryArgs = {
id: Scalars['ID']
};


export type QueryTaxRateArgs = {
id: Scalars['ID']
export type QueryTaxRatesArgs = {
options?: Maybe<TaxRateListOptions>
};


export type QueryTaxCategoryArgs = {
export type QueryTaxRateArgs = {
id: Scalars['ID']
};

Expand Down
3 changes: 2 additions & 1 deletion packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,8 @@ export type QueryOrderByCodeArgs = {
};

export type QueryProductArgs = {
id: Scalars['ID'];
id?: Maybe<Scalars['ID']>;
slug?: Maybe<Scalars['String']>;
languageCode?: Maybe<LanguageCode>;
};

Expand Down
85 changes: 43 additions & 42 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1415,16 +1415,16 @@ export type Mutation = {
createAssets: Array<Asset>,
login: LoginResult,
logout: Scalars['Boolean'],
/** Create a new Channel */
createChannel: Channel,
/** Update an existing Channel */
updateChannel: Channel,
/** Create a new Collection */
createCollection: Collection,
/** Update an existing Collection */
updateCollection: Collection,
/** Move a Collection to a different parent or index */
moveCollection: Collection,
/** Create a new Channel */
createChannel: Channel,
/** Update an existing Channel */
updateChannel: Channel,
/** Create a new Country */
createCountry: Country,
/** Update an existing Country */
Expand Down Expand Up @@ -1497,14 +1497,14 @@ export type Mutation = {
createShippingMethod: ShippingMethod,
/** Update an existing ShippingMethod */
updateShippingMethod: ShippingMethod,
/** Create a new TaxRate */
createTaxRate: TaxRate,
/** Update an existing TaxRate */
updateTaxRate: TaxRate,
/** Create a new TaxCategory */
createTaxCategory: TaxCategory,
/** Update an existing TaxCategory */
updateTaxCategory: TaxCategory,
/** Create a new TaxRate */
createTaxRate: TaxRate,
/** Update an existing TaxRate */
updateTaxRate: TaxRate,
/** Create a new Zone */
createZone: Zone,
/** Update an existing Zone */
Expand Down Expand Up @@ -1546,16 +1546,6 @@ export type MutationLoginArgs = {
};


export type MutationCreateChannelArgs = {
input: CreateChannelInput
};


export type MutationUpdateChannelArgs = {
input: UpdateChannelInput
};


export type MutationCreateCollectionArgs = {
input: CreateCollectionInput
};
Expand All @@ -1571,6 +1561,16 @@ export type MutationMoveCollectionArgs = {
};


export type MutationCreateChannelArgs = {
input: CreateChannelInput
};


export type MutationUpdateChannelArgs = {
input: UpdateChannelInput
};


export type MutationCreateCountryArgs = {
input: CreateCountryInput
};
Expand Down Expand Up @@ -1772,23 +1772,23 @@ export type MutationUpdateShippingMethodArgs = {
};


export type MutationCreateTaxRateArgs = {
input: CreateTaxRateInput
export type MutationCreateTaxCategoryArgs = {
input: CreateTaxCategoryInput
};


export type MutationUpdateTaxRateArgs = {
input: UpdateTaxRateInput
export type MutationUpdateTaxCategoryArgs = {
input: UpdateTaxCategoryInput
};


export type MutationCreateTaxCategoryArgs = {
input: CreateTaxCategoryInput
export type MutationCreateTaxRateArgs = {
input: CreateTaxRateInput
};


export type MutationUpdateTaxCategoryArgs = {
input: UpdateTaxCategoryInput
export type MutationUpdateTaxRateArgs = {
input: UpdateTaxRateInput
};


Expand Down Expand Up @@ -2277,12 +2277,12 @@ export type Query = {
assets: AssetList,
asset?: Maybe<Asset>,
me?: Maybe<CurrentUser>,
channels: Array<Channel>,
channel?: Maybe<Channel>,
activeChannel: Channel,
collections: CollectionList,
collection?: Maybe<Collection>,
collectionFilters: Array<ConfigurableOperation>,
channels: Array<Channel>,
channel?: Maybe<Channel>,
activeChannel: Channel,
countries: CountryList,
country?: Maybe<Country>,
customerGroups: Array<CustomerGroup>,
Expand Down Expand Up @@ -2310,10 +2310,10 @@ export type Query = {
shippingMethod?: Maybe<ShippingMethod>,
shippingEligibilityCheckers: Array<ConfigurableOperation>,
shippingCalculators: Array<ConfigurableOperation>,
taxRates: TaxRateList,
taxRate?: Maybe<TaxRate>,
taxCategories: Array<TaxCategory>,
taxCategory?: Maybe<TaxCategory>,
taxRates: TaxRateList,
taxRate?: Maybe<TaxRate>,
zones: Array<Zone>,
zone?: Maybe<Zone>,
temp__?: Maybe<Scalars['Boolean']>,
Expand All @@ -2340,11 +2340,6 @@ export type QueryAssetArgs = {
};


export type QueryChannelArgs = {
id: Scalars['ID']
};


export type QueryCollectionsArgs = {
languageCode?: Maybe<LanguageCode>,
options?: Maybe<CollectionListOptions>
Expand All @@ -2357,6 +2352,11 @@ export type QueryCollectionArgs = {
};


export type QueryChannelArgs = {
id: Scalars['ID']
};


export type QueryCountriesArgs = {
options?: Maybe<CountryListOptions>
};
Expand Down Expand Up @@ -2438,7 +2438,8 @@ export type QueryProductsArgs = {


export type QueryProductArgs = {
id: Scalars['ID'],
id?: Maybe<Scalars['ID']>,
slug?: Maybe<Scalars['String']>,
languageCode?: Maybe<LanguageCode>
};

Expand Down Expand Up @@ -2473,17 +2474,17 @@ export type QueryShippingMethodArgs = {
};


export type QueryTaxRatesArgs = {
options?: Maybe<TaxRateListOptions>
export type QueryTaxCategoryArgs = {
id: Scalars['ID']
};


export type QueryTaxRateArgs = {
id: Scalars['ID']
export type QueryTaxRatesArgs = {
options?: Maybe<TaxRateListOptions>
};


export type QueryTaxCategoryArgs = {
export type QueryTaxRateArgs = {
id: Scalars['ID']
};

Expand Down
Loading

0 comments on commit a2d847d

Please sign in to comment.