Skip to content

Commit

Permalink
feat(IN-3927): UDM enhancements 2 (#1488)
Browse files Browse the repository at this point in the history
* feat: extend categoryList query

* chore: changeset

* chore: recreate fixtures
  • Loading branch information
Razz21 authored Jan 26, 2024
1 parent 593800e commit 60af3cb
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 17 deletions.
11 changes: 11 additions & 0 deletions .changeset/chatty-beds-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@vue-storefront/magento-api": patch
"@vue-storefront/magento-types": patch
---

**[FIXED]** [`CategoryListQuery`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/CategoryListQuery) returns `url_key` property on each children level

**[CHANGED]** Enhanced default GQL queries

- [`CategoryListQuery`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/CategoryListQuery)
- fetch up to 5th level nested categories `children`
13 changes: 13 additions & 0 deletions packages/api-client/src/api/categoryList/categoryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default `
position
product_count
uid
url_key
url_path
url_suffix
children {
Expand All @@ -35,6 +36,18 @@ export default `
url_key
url_path
url_suffix
children {
include_in_menu
is_anchor
level
name
position
product_count
uid
url_key
url_path
url_suffix
}
}
}
}
Expand Down
100 changes: 93 additions & 7 deletions packages/api-types/src/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7714,13 +7714,99 @@ export type CartQuery = {
export type CategoryListQueryVariables = Exact<{ [key: string]: never; }>;

export type CategoryListQuery = {
categories?: {
items?: Array<{
product_count?: number | null | undefined, name?: string | null | undefined, uid: string, children?: Array<{
include_in_menu?: number | null | undefined, is_anchor?: number | null | undefined, level?: number | null | undefined, name?: string | null | undefined, position?: number | null | undefined, product_count?: number | null | undefined, uid: string, url_key?: string | null | undefined, url_path?: string | null | undefined, url_suffix?: string | null | undefined, children?: Array<{ include_in_menu?: number | null | undefined, is_anchor?: number | null | undefined, level?: number | null | undefined, name?: string | null | undefined, position?: number | null | undefined, product_count?: number | null | undefined, uid: string, url_key?: string | null | undefined, url_path?: string | null | undefined, url_suffix?: string | null | undefined, children?: Array<{ include_in_menu?: number | null | undefined, is_anchor?: number | null | undefined, level?: number | null | undefined, name?: string | null | undefined, position?: number | null | undefined, product_count?: number | null | undefined, uid: string, url_key?: string | null | undefined, url_path?: string | null | undefined, url_suffix?: string | null | undefined } | null | undefined> | null | undefined } | null | undefined> | null | undefined
} | null | undefined> | null | undefined
} | null | undefined> | null | undefined
} | null | undefined
categories?:
| {
items?:
| Array<
| {
product_count?: number | null | undefined;
name?: string | null | undefined;
uid: string;
children?:
| Array<
| {
include_in_menu?: number | null | undefined;
is_anchor?: number | null | undefined;
level?: number | null | undefined;
name?: string | null | undefined;
position?: number | null | undefined;
product_count?: number | null | undefined;
uid: string;
url_key?: string | null | undefined;
url_path?: string | null | undefined;
url_suffix?: string | null | undefined;
children?:
| Array<
| {
include_in_menu?: number | null | undefined;
is_anchor?: number | null | undefined;
level?: number | null | undefined;
name?: string | null | undefined;
position?: number | null | undefined;
product_count?: number | null | undefined;
uid: string;
url_key?: string | null | undefined;
url_path?: string | null | undefined;
url_suffix?: string | null | undefined;
children?:
| Array<
| {
include_in_menu?: number | null | undefined;
is_anchor?: number | null | undefined;
level?: number | null | undefined;
name?: string | null | undefined;
position?: number | null | undefined;
product_count?: number | null | undefined;
uid: string;
url_key?: string | null | undefined;
url_path?: string | null | undefined;
url_suffix?: string | null | undefined;
children?:
| Array<
| {
include_in_menu?: number | null | undefined;
is_anchor?: number | null | undefined;
level?: number | null | undefined;
name?: string | null | undefined;
position?: number | null | undefined;
product_count?: number | null | undefined;
uid: string;
url_key?: string | null | undefined;
url_path?: string | null | undefined;
url_suffix?: string | null | undefined;
}
| null
| undefined
>
| null
| undefined;
}
| null
| undefined
>
| null
| undefined;
}
| null
| undefined
>
| null
| undefined;
}
| null
| undefined
>
| null
| undefined;
}
| null
| undefined
>
| null
| undefined;
}
| null
| undefined;
};

export type CategorySearchQueryVariables = Exact<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Server",
"nginx/1.14.2",
"Date",
"Tue, 23 Jan 2024 10:41:00 GMT",
"Fri, 26 Jan 2024 10:25:48 GMT",
"Content-Type",
"application/json",
"Content-Length",
Expand All @@ -34,9 +34,9 @@
"Content-Encoding",
"gzip",
"X-Varnish",
"39221259 39312428",
"40629014",
"Age",
"2195",
"0",
"Pragma",
"no-cache",
"Expires",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"scope": "https://magento2-instance.vuestorefront.io:443",
"method": "GET",
"path": "/graphql?query=query+categoryList%7Bcategories%7Bitems%7Bchildren%7Binclude_in_menu+is_anchor+level+name+position+product_count+uid+url_key+url_path+url_suffix+children%7Binclude_in_menu+is_anchor+level+name+position+product_count+uid+url_path+url_suffix+children%7Binclude_in_menu+is_anchor+level+name+position+product_count+uid+url_key+url_path+url_suffix+__typename%7D__typename%7D__typename%7Dproduct_count+name+uid+__typename%7D__typename%7D%7D&operationName=categoryList&variables=%7B%7D",
"path": "/graphql?query=query+categoryList%7Bcategories%7Bitems%7Bchildren%7Binclude_in_menu+is_anchor+level+name+position+product_count+uid+url_key+url_path+url_suffix+children%7Binclude_in_menu+is_anchor+level+name+position+product_count+uid+url_key+url_path+url_suffix+children%7Binclude_in_menu+is_anchor+level+name+position+product_count+uid+url_key+url_path+url_suffix+children%7Binclude_in_menu+is_anchor+level+name+position+product_count+uid+url_key+url_path+url_suffix+__typename%7D__typename%7D__typename%7D__typename%7Dproduct_count+name+uid+__typename%7D__typename%7D%7D&operationName=categoryList&variables=%7B%7D",
"body": "",
"status": 200,
"response": [
"1f8b0800000000000003d5985d6fda301486ff0af2c57643c602b4eb90b8281bfb924063a4aaa631455e6212979064b153c62afefb1c526227f1701850d81d71ce397a9f63fbbc280fc0861482ce03b020454e10614492274cd19cfdf8c6d65decd911f2d70fd8b7bcd84626f6cd39f263d07959079898d0b7dc205a3f79e81e79a0d3ac031fce11e8805b17d2e7a436440b5007614030c5012ba6b38728b0638b9a5610fb749d1c639b650c7e3b5d161b479e39434bb6b06025344c347f5d23590f2175a52f483c9de25fecd50b97ce3db628c8ff5e07a64997217a54f626255e1a1142605597d0e9393a5d4617b0c81c58b304f6ea3223bbbb2e903da68b4cc2d2369a1de4b632b9461012c5365cf07db8eb7725da260dcaaa6847d0d9ce747e82d60c519554bdc9a50ef28dbd4b0b687f6bb0083169c8a24b4c073a3b1cf24310d8ecbad59ed5c60b0429717154402e9f251179944776d3721af46d8df082155b5025fbf82d3110ca77a0b5b50337f90e50965d11b7147a7cb65e0493bd36a03fcb33b6cb8c6dcef8b5c098a457852cc5ee4279b871c9e74f2fa03498ab0e795318981fe523e8475ae8b853e833f4d533a8c5b55af9ad0a93f42d5b95639834cae1c73f9363f6463d7304c4823393757e754649fce18ee4be0756f6ef65507077c93cbac8ba63f4f3dd2935e5b4cedebee24a8bd78acf8ed3bbbace658ee4ae2e6b2c97cffdfcecdd9cdf2ce3a69a9babd0d579e7e6e246d1e1126b566116829e80a98a6d0b5096ccb6955485a8ffc4aef9bf1563209b2b1b1338b5550bdbe3c8ac5abe3d82fa8d499f9f450b6833a94557602b459eb735bf4730525cc8169faf8b6ebe2d4e9a2d34445839b83bf7a0a33c9dd92d1a5e77bb65696cb3d2224ff79983eb7f87a98f08a9f57fc638644954751eb38f08c3911c669a56d49050f11464b7905aaed2ae5e67388e1c679195d90f627744f517b831f4508eef72dbb7b78271913459001656f6e22c1e992b3d53fc164d61ecd1da260764f2d2f6ff4303bf20c22a82d56af507e99f2c66f3140000"
"1f8b0800000000000003d598516fda3010c7bf0af2c3f6026301da75487d285bb77512688c54d534a6c84d0c3184248b9d3156f1dde7101a3b8e8bb39685f216db77a7fb9dcff65fb9030ea41074ef800d299a0611462419618a16ece33b9b77b1e744c8df0cb06f7bb1832cec5b0be4c7a0fbba0e30b1a06fbb41b41979e817f240b755073e5c20d005372ea42f496d8096a00ec280608a0316cc60832870629b5a7610fb74e31c638779f4ff4ccf996d1c79d61cadd8c492856860d2f0373192f9105257b940e2c904ff664baf5cbaf0d8a490fe8f3ab02cba0ad136b37729f1ca8c1002ebba82cec8d1192aba8059e6c05a05b037a719d9ec4222dbba8b4cc2d42e9a7f48b79da56b0621d16cc309df87d9653e5bcabc1b0fa53c6e1696f7947e274bff33b4e788ea088c1627e8e7096669805210e3a6caba9a06e3c89f82c06167b2f6a2365a2248898b23a900c586130b30cc17c04dc335a0ef34080f58b22065bcab2e908950be1eed9df5b8965a9a7997842f98564dda8b60d20726f4e779e24e91b8c389bf49c4897b59e482ede399f757117e9df5024a8385ee38b484fbf72a5f8cdb34c08e72a82cf67eaf7d81befe566b730a3b4f1126ee6519c6cda279d59d3c622bfa5b4c00960401d9f8972756d8ffaf467e6ab95412aa2f490cc50d7792d5ca941eed42890e2b2f3a673cd32b85bc50a5bbbd940e2f2c0c9efb502d2c76a7cf25c591090a7e14cdeb7282425708bddff31612a6fcac26ea40072d19554e5846390888b64a39681925aba3540c5c3e997db5625097a1b87a18ad206ce254a515b4d9dfab84e7ae1104d0b9522394202d581e9336f88860a439d26d7e7b2fcff3459aa6de42798499bdcb831e9c6a3b373b79830b29d7dbd45bca95ed259fafa64739d0074c7d4448edf2678c43e64475ed9afd5b190c25ba491aaa81845005d4878caae6be81d476b5afe5db0c762ac12e33ff02627ea9cac743ff2b73043d94633eddf513537a3d49ea2c000b334fe2949becccc8327e8f2630f668edde0764e9a55bf288027e45844504ebf5fa2f3eca13063c160000"
],
"rawHeaders": [
"Server",
"nginx/1.14.2",
"Date",
"Tue, 23 Jan 2024 10:41:00 GMT",
"Fri, 26 Jan 2024 10:25:48 GMT",
"Content-Type",
"application/json",
"Content-Length",
"755",
"Transfer-Encoding",
"chunked",
"Connection",
"keep-alive",
"Vary",
Expand All @@ -34,9 +34,9 @@
"Content-Encoding",
"gzip",
"X-Varnish",
"39221257 39395432",
"40839590",
"Age",
"2195",
"0",
"Pragma",
"no-cache",
"Expires",
Expand Down

0 comments on commit 60af3cb

Please sign in to comment.