diff --git a/.changeset/grumpy-papayas-obey.md b/.changeset/grumpy-papayas-obey.md new file mode 100644 index 000000000..e1f736886 --- /dev/null +++ b/.changeset/grumpy-papayas-obey.md @@ -0,0 +1,5 @@ +--- +"@vue-storefront/magento-api": patch +--- + +[ADDED] `CategoriesQuery` type for `categories` endpoint. diff --git a/packages/api-client/src/api/categories/index.ts b/packages/api-client/src/api/categories/index.ts index 6bc74b1b3..f78e8bf61 100644 --- a/packages/api-client/src/api/categories/index.ts +++ b/packages/api-client/src/api/categories/index.ts @@ -6,6 +6,8 @@ import categoriesQuery from "./categories"; import { Context } from "../../types/context"; import getHeaders from "../getHeaders"; +export type CategoriesQuery = Required>; + /** * Fetch list of all categories matching specified filters * @@ -64,7 +66,7 @@ export async function categories( params: QueryCategoriesArgs, customQuery: CustomQuery = { categories: "categories" }, customHeaders: CustomHeaders = {} -): Promise> { +): Promise> { const { categories: categoriesGQL } = context.extendQuery(customQuery, { categories: { query: categoriesQuery, @@ -72,7 +74,7 @@ export async function categories( }, }); - return context.client.query({ + return context.client.query({ query: gql` ${categoriesGQL.query} `,