'Product Variant Name using GraphQL in Bigcommerce

I'm using GQL query to show product variant information inside my table but when I'm calling product name its not working. Even my SKU,UPC/MPN and all rest values are showing but don't know how to show product name. This is my site theme table Table And this is my dashboard Dashboard Table This is my GQL query through which I'm taking variant information Code



Solution 1:[1]

Variants are associated with options that do have names. We gather the names for all options and concatenate them together to get the variant's name. e.g. "Large Red".

Here's the variant part of the graphql we use to get that information:

variants(first:50 entityIds:[1,2,3]){
    edges{
        node{
            options(first:50){
                edges{
                    node{
                        displayName values(first:50){
                            edges{
                                node{
                                    label
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Solution 2:[2]

Variants do not have their own names (they only have a SKU code), so you can simply re-use the product's name. You can add the name field to your query underneath the product node, on the same level as variants.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tony McCreath
Solution 2 Nathan Booker