Skip to content

Commit

Permalink
feat(core): Create APIs & resolver for Tag operations
Browse files Browse the repository at this point in the history
Relates to #316.
  • Loading branch information
michaelbromley committed Jan 18, 2021
1 parent 71cf3b9 commit 6630063
Show file tree
Hide file tree
Showing 16 changed files with 664 additions and 5 deletions.
68 changes: 68 additions & 0 deletions packages/admin-ui/src/lib/core/src/common/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export type Query = {
shippingEligibilityCheckers: Array<ConfigurableOperationDefinition>;
shippingMethod?: Maybe<ShippingMethod>;
shippingMethods: ShippingMethodList;
tag: Tag;
tags: TagList;
taxCategories: Array<TaxCategory>;
taxCategory?: Maybe<TaxCategory>;
taxRate?: Maybe<TaxRate>;
Expand Down Expand Up @@ -256,6 +258,16 @@ export type QueryShippingMethodsArgs = {
};


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


export type QueryTagsArgs = {
options?: Maybe<TagListOptions>;
};


export type QueryTaxCategoryArgs = {
id: Scalars['ID'];
};
Expand Down Expand Up @@ -346,6 +358,8 @@ export type Mutation = {
createRole: Role;
/** Create a new ShippingMethod */
createShippingMethod: ShippingMethod;
/** Create a new Tag */
createTag: Tag;
/** Create a new TaxCategory */
createTaxCategory: TaxCategory;
/** Create a new TaxRate */
Expand Down Expand Up @@ -385,6 +399,8 @@ export type Mutation = {
deleteRole: DeletionResponse;
/** Delete a ShippingMethod */
deleteShippingMethod: DeletionResponse;
/** Delete an existing Tag */
deleteTag: DeletionResponse;
/** Deletes a TaxCategory */
deleteTaxCategory: DeletionResponse;
/** Delete a TaxRate */
Expand Down Expand Up @@ -468,6 +484,8 @@ export type Mutation = {
updateRole: Role;
/** Update an existing ShippingMethod */
updateShippingMethod: ShippingMethod;
/** Update an existing Tag */
updateTag: Tag;
/** Update an existing TaxCategory */
updateTaxCategory: TaxCategory;
/** Update an existing TaxRate */
Expand Down Expand Up @@ -635,6 +653,11 @@ export type MutationCreateShippingMethodArgs = {
};


export type MutationCreateTagArgs = {
input: CreateTagInput;
};


export type MutationCreateTaxCategoryArgs = {
input: CreateTaxCategoryInput;
};
Expand Down Expand Up @@ -744,6 +767,11 @@ export type MutationDeleteShippingMethodArgs = {
};


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


export type MutationDeleteTaxCategoryArgs = {
id: Scalars['ID'];
};
Expand Down Expand Up @@ -977,6 +1005,11 @@ export type MutationUpdateShippingMethodArgs = {
};


export type MutationUpdateTagArgs = {
input: UpdateTagInput;
};


export type MutationUpdateTaxCategoryArgs = {
input: UpdateTaxCategoryInput;
};
Expand Down Expand Up @@ -2337,6 +2370,15 @@ export type StockMovementList = {
totalItems: Scalars['Int'];
};

export type CreateTagInput = {
value: Scalars['String'];
};

export type UpdateTagInput = {
id: Scalars['ID'];
value?: Maybe<Scalars['String']>;
};

export type CreateTaxCategoryInput = {
name: Scalars['String'];
};
Expand Down Expand Up @@ -4107,6 +4149,12 @@ export type Tag = Node & {
value: Scalars['String'];
};

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

export type TaxCategory = Node & {
__typename?: 'TaxCategory';
id: Scalars['ID'];
Expand Down Expand Up @@ -4255,6 +4303,13 @@ export type ShippingMethodListOptions = {
filter?: Maybe<ShippingMethodFilterParameter>;
};

export type TagListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
sort?: Maybe<TagSortParameter>;
filter?: Maybe<TagFilterParameter>;
};

export type TaxRateListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
Expand Down Expand Up @@ -4551,6 +4606,19 @@ export type ShippingMethodSortParameter = {
fulfillmentHandlerCode?: Maybe<SortOrder>;
};

export type TagFilterParameter = {
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
value?: Maybe<StringOperators>;
};

export type TagSortParameter = {
id?: Maybe<SortOrder>;
createdAt?: Maybe<SortOrder>;
updatedAt?: Maybe<SortOrder>;
value?: Maybe<SortOrder>;
};

export type TaxRateFilterParameter = {
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const result: PossibleTypesResultData = {
'PromotionList',
'RoleList',
'ShippingMethodList',
'TagList',
'TaxRateList',
],
Node: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export type Query = {
fulfillmentHandlers: Array<ConfigurableOperationDefinition>;
testShippingMethod: TestShippingMethodResult;
testEligibleShippingMethods: Array<ShippingMethodQuote>;
tag: Tag;
tags: TagList;
taxCategories: Array<TaxCategory>;
taxCategory?: Maybe<TaxCategory>;
taxRates: TaxRateList;
Expand Down Expand Up @@ -224,6 +226,14 @@ export type QueryTestEligibleShippingMethodsArgs = {
input: TestEligibleShippingMethodsInput;
};

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

export type QueryTagsArgs = {
options?: Maybe<TagListOptions>;
};

export type QueryTaxCategoryArgs = {
id: Scalars['ID'];
};
Expand Down Expand Up @@ -399,6 +409,12 @@ export type Mutation = {
updateShippingMethod: ShippingMethod;
/** Delete a ShippingMethod */
deleteShippingMethod: DeletionResponse;
/** Create a new Tag */
createTag: Tag;
/** Update an existing Tag */
updateTag: Tag;
/** Delete an existing Tag */
deleteTag: DeletionResponse;
/** Create a new TaxCategory */
createTaxCategory: TaxCategory;
/** Update an existing TaxCategory */
Expand Down Expand Up @@ -776,6 +792,18 @@ export type MutationDeleteShippingMethodArgs = {
id: Scalars['ID'];
};

export type MutationCreateTagArgs = {
input: CreateTagInput;
};

export type MutationUpdateTagArgs = {
input: UpdateTagInput;
};

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

export type MutationCreateTaxCategoryArgs = {
input: CreateTaxCategoryInput;
};
Expand Down Expand Up @@ -2139,6 +2167,15 @@ export type StockMovementList = {
totalItems: Scalars['Int'];
};

export type CreateTagInput = {
value: Scalars['String'];
};

export type UpdateTagInput = {
id: Scalars['ID'];
value?: Maybe<Scalars['String']>;
};

export type CreateTaxCategoryInput = {
name: Scalars['String'];
};
Expand Down Expand Up @@ -3836,6 +3873,11 @@ export type Tag = Node & {
value: Scalars['String'];
};

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

export type TaxCategory = Node & {
id: Scalars['ID'];
createdAt: Scalars['DateTime'];
Expand Down Expand Up @@ -3978,6 +4020,13 @@ export type ShippingMethodListOptions = {
filter?: Maybe<ShippingMethodFilterParameter>;
};

export type TagListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
sort?: Maybe<TagSortParameter>;
filter?: Maybe<TagFilterParameter>;
};

export type TaxRateListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
Expand Down Expand Up @@ -4274,6 +4323,19 @@ export type ShippingMethodSortParameter = {
fulfillmentHandlerCode?: Maybe<SortOrder>;
};

export type TagFilterParameter = {
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
value?: Maybe<StringOperators>;
};

export type TagSortParameter = {
id?: Maybe<SortOrder>;
createdAt?: Maybe<SortOrder>;
updatedAt?: Maybe<SortOrder>;
value?: Maybe<SortOrder>;
};

export type TaxRateFilterParameter = {
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
Expand Down
6 changes: 6 additions & 0 deletions packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,12 @@ export type Tag = Node & {
value: Scalars['String'];
};

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

export type TaxCategory = Node & {
__typename?: 'TaxCategory';
id: Scalars['ID'];
Expand Down
Loading

0 comments on commit 6630063

Please sign in to comment.