-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(IN-3927): udm enhancements (#1486)
* feat: categorylistquery * feat: categorysearchquery * feat: productlistquery * chore: regenerate fixtures * chore: changeset * chore: udpate changelog * chore: update changelog
- Loading branch information
Showing
13 changed files
with
186 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
"@vue-storefront/magento-api": minor | ||
"@vue-storefront/magento-types": minor | ||
--- | ||
|
||
**[CHANGED]** Enhanced default GQL queries | ||
|
||
- [`CategorySearchQuery`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/CategorySearchQuery) new fields: | ||
- `url_key` - The url key assigned to the category. | ||
- `children` - Child categories tree. | ||
- `include_in_menu` | ||
- `is_anchor` | ||
- `level` | ||
- `name` | ||
- `position` | ||
- `product_count` | ||
- `uid` | ||
- `url_key` | ||
- `url_path` | ||
- `url_suffix` | ||
|
||
```js | ||
// get category `children` categories | ||
|
||
const category = sdk.commerce.categorySearch(); | ||
const children = category.children; | ||
``` | ||
|
||
- [`CategoryListQuery`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/CategoryListQuery) new fields: | ||
- `children.url_key` - The url key assigned to the category. | ||
|
||
```js | ||
// get `url_key` of category children | ||
|
||
const categoryList = sdk.commerce.categoryList(); | ||
|
||
for (let categoryChildren of categoryList.children) { | ||
const url_key = categoryChildren.url_key; | ||
} | ||
``` | ||
|
||
- [`ProductListsQuery`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/ProductListsQuery) new fields: | ||
- `variants` - An array of variants of [`ConfigurableProduct`](https://docs.vuestorefront.io/integrations/magento/api/magento-types/ConfigurableProduct) | ||
|
||
```js | ||
// get ConfigurableProduct `variants` products | ||
|
||
const products = sdk.commerce.products(); | ||
|
||
for (let product of products) { | ||
if (product.__typename === "ConfigurableProduct") { | ||
const variants = products.variants; | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.