magento / catalog-storefront

Open Software License 3.0
7 stars 18 forks source link

Map Configurable product to GQL schema #289

Open mslabko opened 4 years ago

mslabko commented 4 years ago

Source: https://github.com/magento/catalog-storefront/issues/189 TODO: AC

GraphQL => proto Mapping:

type ConfigurableProduct {
    variants: [ConfigurableVariant]                    // we don't need this as part of proto schema
    configurable_options: [ConfigurableProductOptions] // we don't need this as part of proto schema
}

type ConfigurableVariant {                    // Variant
    attributes: [ConfigurableAttributeOption] //ProductVariant::option_value_id
    product: SimpleProduct                    // could be retrieved from variant id by the rule variantID == productID
}

type ConfigurableAttributeOption { // ProductOption
    label:                         // ProductOption::label
    code:                          // deprecated
    value_index:                   // ProductOption::values
    uid:                   // ProductOptionValue::id
}

type ConfigurableProductOptions { // ProductOption
    id: Int                       // ProductOption::id
    attribute_id:                 // deprecated
    attribute_id_v2:              // deprecated
    attribute_code:               // deprecated
    label:                        // ProductOption::label
    position:                     // ProductOption::sort_order
    use_default:                  // deprecated
    values:                       // ProductOptionValue::default
    product_id:                   // deprecated. could be retrieved from variant id by the rule variantID == productID
}

type ConfigurableProductOptionsValues { // ProductOptionValue
    value_index:                        // ProductOptionValue::id
    label:                              // ProductOptionValue::label
    default_label:                      // deprecated
    store_label:                        // deprecated
    use_default_value:                  // ProductOptionValue::default
}
m2-assistant[bot] commented 4 years ago

Hi @mslabko. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this