inventory
inventory copied to clipboard
New Module to enable MSI for Configurable Product GraphQl
New Module to enable MSI for Configurable Product GraphQl
Description
Added a new module to enable MSI for Configurable Product GraphQl. The Magento_InventoryConfigurableProduct module is overriding the Magento_ConfigurableProduct_Plugin_Model_ResourceModel_Attribute_InStockOptionSelectBuilder plugin, but no module is overriding the Magento_ConfigurableProduct_Plugin_Model_ResourceModel_Attribute_InStockOptionSelectBuilder_GraphQl plugin. This new module solves the issue.
Fixed Issues
Using graphql to read a configurable product options leads to have an empty array of option values. This happens because the Magento_ConfigurableProduct_Plugin_Model_ResourceModel_Attribute_InStockOptionSelectBuilder_GraphQl plugin uses a SQL query joining the module-catalog-inventory tables instead the module-inventory tables.
Manual testing scenarios
- Create a new inventory source
- Create a new inventory stock associated with websites and the new inventory source
- Create Configurable Product and variants
- Create new “in stock” Source Items on the new Inventory Source for the product variants

- Remove Default Source Items
- Run graphql
query getProductDetailForProductPage($urlKey: String!) {
products(filter: { url_key: { eq: $urlKey } }) {
items {
id
... on ConfigurableProduct {
configurable_options {
attribute_code
attribute_id
id
label
values {
default_label
label
store_label
use_default_value
value_index
swatch_data {
... on ImageSwatchData {
thumbnail
}
value
}
}
}
}
}
}
}
products.items.configurable_options.valuesshould return an array of values
Contribution checklist
- [ ] Pull request has a meaningful description of its purpose
- [ ] All commits are accompanied by meaningful commit messages
- [ ] All new or changed code is covered with unit/integration tests (if applicable)
- [ ] All automated tests passed successfully (all builds are green)
@magento run all tests