Skip to content

Commit

Permalink
fix(core): Remove LanguageCode arg from Shop API
Browse files Browse the repository at this point in the history
Closes #130

BREAKING CHANGE: The `languageCode` argument has been removed from all Shop API queries, namely `product`, `products`, `collection` and `collections`. Instead, LanguageCode should be specified as a query param.
  • Loading branch information
michaelbromley committed Jul 26, 2019
1 parent 663fbd8 commit 3b80224
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 22 deletions.
6 changes: 0 additions & 6 deletions packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1845,13 +1845,11 @@ export type Query = {
};

export type QueryCollectionsArgs = {
languageCode?: Maybe<LanguageCode>;
options?: Maybe<CollectionListOptions>;
};

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

export type QueryOrderArgs = {
Expand All @@ -1865,11 +1863,9 @@ export type QueryOrderByCodeArgs = {
export type QueryProductArgs = {
id?: Maybe<Scalars['ID']>;
slug?: Maybe<Scalars['String']>;
languageCode?: Maybe<LanguageCode>;
};

export type QueryProductsArgs = {
languageCode?: Maybe<LanguageCode>;
options?: Maybe<ProductListOptions>;
};

Expand Down Expand Up @@ -1957,8 +1953,6 @@ export type SearchInput = {
export type SearchReindexResponse = {
__typename?: 'SearchReindexResponse';
success: Scalars['Boolean'];
timeTaken: Scalars['Int'];
indexedItemCount: Scalars['Int'];
};

export type SearchResponse = {
Expand Down
2 changes: 0 additions & 2 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2924,8 +2924,6 @@ export type SearchInput = {
export type SearchReindexResponse = {
__typename?: 'SearchReindexResponse',
success: Scalars['Boolean'],
timeTaken: Scalars['Int'],
indexedItemCount: Scalars['Int'],
};

export type SearchResponse = {
Expand Down
2 changes: 0 additions & 2 deletions packages/core/e2e/graphql/generated-e2e-admin-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2825,8 +2825,6 @@ export type SearchInput = {
export type SearchReindexResponse = {
__typename?: 'SearchReindexResponse';
success: Scalars['Boolean'];
timeTaken: Scalars['Int'];
indexedItemCount: Scalars['Int'];
};

export type SearchResponse = {
Expand Down
6 changes: 0 additions & 6 deletions packages/core/e2e/graphql/generated-e2e-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1845,13 +1845,11 @@ export type Query = {
};

export type QueryCollectionsArgs = {
languageCode?: Maybe<LanguageCode>;
options?: Maybe<CollectionListOptions>;
};

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

export type QueryOrderArgs = {
Expand All @@ -1865,11 +1863,9 @@ export type QueryOrderByCodeArgs = {
export type QueryProductArgs = {
id?: Maybe<Scalars['ID']>;
slug?: Maybe<Scalars['String']>;
languageCode?: Maybe<LanguageCode>;
};

export type QueryProductsArgs = {
languageCode?: Maybe<LanguageCode>;
options?: Maybe<ProductListOptions>;
};

Expand Down Expand Up @@ -1957,8 +1953,6 @@ export type SearchInput = {
export type SearchReindexResponse = {
__typename?: 'SearchReindexResponse';
success: Scalars['Boolean'];
timeTaken: Scalars['Int'];
indexedItemCount: Scalars['Int'];
};

export type SearchResponse = {
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/api/schema/shop-api/shop.api.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ type Query {
activeCustomer: Customer
activeOrder: Order
availableCountries: [Country!]!
collections(languageCode: LanguageCode, options: CollectionListOptions): CollectionList!
collection(id: ID!, languageCode: LanguageCode): Collection
collections(options: CollectionListOptions): CollectionList!
collection(id: ID!): Collection
eligibleShippingMethods: [ShippingMethodQuote!]!
me: CurrentUser
nextOrderStates: [String!]!
order(id: ID!): Order
orderByCode(code: String!): Order
"Get a Product either by id or slug. If neither 'id' nor 'slug' is speicified, an error will result."
product(id: ID, slug: String, languageCode: LanguageCode): Product
products(languageCode: LanguageCode, options: ProductListOptions): ProductList!
product(id: ID, slug: String): Product
products(options: ProductListOptions): ProductList!
search(input: SearchInput!): SearchResponse!
}

Expand Down
2 changes: 1 addition & 1 deletion schema-admin.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion schema-shop.json

Large diffs are not rendered by default.

0 comments on commit 3b80224

Please sign in to comment.