LogoLogo
User ManualChangelogRoadmapAboutYouTube
GraphQL API
GraphQL API
  • GraphQL API
  • Overview
    • Query types
      • Stream queries
    • Error codes
    • Schema
      • Queries
      • Mutations
      • Objects
      • Interfaces
      • Scalars
      • Input objects
      • Enums
      • Unions
  • CHANGELOG
    • Changelog
    • Breaking changes
  • Guides
    • Authentication
    • Basic query tutorial
    • Batching mutations
    • Integrating data
  • Query examples
    • List of products with attributes and they values in product stream
    • Get information about specific product and specific attribute values in specific language
    • List of 100 grouped products with simple and variable products in stream
    • List of grouped products with simple and variable products AFTER some end cursor
    • List of active languages
    • List of templates with attributes
    • List of all multimedia in stream
    • List of product relations for a specific product
    • Get values of custom fields
    • Create a simple product
    • Create a grouping product
    • Create a variable product
    • Add a child product to grouping one
    • Set quantity of child product
    • Remove a child product from grouping one
    • Add a variant to variable product
    • Get products with variants, binding attributes and variants list
    • Remove a variant product from variable one
    • Multimedia create
    • Add images to the gallery attribute
    • Change the name of the multimedia
    • Set alternative value for a multimedia
    • Delete Multimedia
    • Add a file to the product
    • Get attributes list by SKU
    • Create a product and assign / modify attributes values
    • Assign the template to a product
    • Create a category
    • Get category tree by category tree code
    • Get a specific category with values of the category attribute
    • Set multiple options in multiselect attribute on specific product
  • Add option to select type attribute
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Query examples

Get information about specific product and specific attribute values in specific language

PreviousList of products with attributes and they values in product streamNextList of 100 grouped products with simple and variable products in stream

Last updated 1 year ago

Was this helpful?

This is an example of how you can get values of specific attributes in specific languages of a specific product using pagination.

Please keep in mind that this is just an example and more data can be pulled. How to deal with other attribute types can be seen in the fragment AttributeValue .

query getAttValues {
    product(sku: "0123456789") {
        # SKU of a single product to get data from
        sku
        createdAt
        editedAt
        template {
            code
        }
        attributeList(
            first: 10 # nuber of entries to return in a single page (max response time is 60s)
            after: "YXJyYXljb25uZWN0aW9uOjA=" # endCursor from the response to get rest of the data if "hasNextPage": true
            codes: [
                # attributes to get values from
                "name"
                "color"
                "short_description"
                "price_local_eur"
                "galeria_zdjec"
            ]
        ) {
            ... on AttributeValueConnection {
                pageInfo {
                    hasNextPage
                    endCursor
                }
                edges {
                    node {
                        ... on PriceAttributeValue {
                            priceAttribute: attribute {
                                # currency might be useful in the price context
                                currency
                            }
                            priceAttributeValue: translations(
                                languages: ["en_GB", "pl_PL"]
                            ) {
                                language
                                value
                            }
                        }
                        ... on SelectAttributeValue {
                            SelectAttributeValue: translations(
                                languages: ["en_GB", "pl_PL"]
                            ) {
                                language
                                translatedValue {
                                    ...OptionTranslatedValue
                                }
                            }
                        }
                        ... on TextAttributeValue {
                            attribute {
                                name(languages: ["en_GB", "pl_PL"]) {
                                    language
                                    value
                                }
                            }
                            TextAttributeValue: translations(
                                languages: ["en_GB", "pl_PL"]
                            ) {
                                language
                                value
                            }
                        }
                        ... on TextareaAttributeValue {
                            attribute {
                                name(languages: ["en_GB", "pl_PL"]) {
                                    language
                                    value
                                }
                            }
                            TextareaAttributeValue: translations(
                                languages: ["en_GB", "pl_PL"]
                            ) {
                                language
                                value
                            }
                        }
                        ... on GalleryAttributeValue {
                            GalleryAttributeValue: translations {
                                language
                                value {
                                    ...Multimedia
                                }
                            }
                        }
                    }
                }
            }
        }
        __typename
    }
}

fragment Multimedia on Multimedia {
    path
    name
    extension
    mime
    sizeInBytes: size
    alt(languages: ["en_GB", "pl_PL"]) {
        language
        value
    }
    title(languages: ["en_GB", "pl_PL"]) {
        language
        value
    }
}
fragment OptionTranslatedValue on OptionTranslatedValue {
    code
    name
}
{
    "data": {
        "product": {
            "sku": "0123456789",
            "createdAt": "2024-04-04T11:44:54+00:00",
            "editedAt": "2024-04-04T13:33:46+00:00",
            "template": {
                "code": "GraphQL"
            },
            "attributeList": {
                "pageInfo": {
                    "hasNextPage": false,
                    "endCursor": "YXJyYXljb25uZWN0aW9uOjQ="
                },
                "edges": [
                    {
                        "node": {
                            "SelectAttributeValue": [
                                {
                                    "language": "en_GB",
                                    "translatedValue": {
                                        "code": "blk",
                                        "name": "Black"
                                    }
                                },
                                {
                                    "language": "pl_PL",
                                    "translatedValue": {
                                        "code": "blk",
                                        "name": "Czarny"
                                    }
                                }
                            ]
                        }
                    },
                    {
                        "node": {
                            "attribute": {
                                "name": [
                                    {
                                        "language": "en_GB",
                                        "value": "Short description"
                                    },
                                    {
                                        "language": "pl_PL",
                                        "value": "Krótki opis"
                                    }
                                ]
                            },
                            "TextareaAttributeValue": [
                                {
                                    "language": "en_GB",
                                    "value": "Short countertop description"
                                },
                                {
                                    "language": "pl_PL",
                                    "value": "Krótki opis blatu"
                                }
                            ]
                        }
                    },
                    {
                        "node": {
                            "priceAttribute": {
                                "currency": "EUR"
                            },
                            "priceAttributeValue": [
                                {
                                    "language": "en_GB",
                                    "value": 10.1
                                },
                                {
                                    "language": "pl_PL",
                                    "value": 9.99
                                }
                            ]
                        }
                    },
                    {
                        "node": {
                            "GalleryAttributeValue": [
                                {
                                    "language": "en_GB",
                                    "value": [
                                        {
                                            "path": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
                                            "name": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
                                            "extension": "webp",
                                            "mime": "image\/webp",
                                            "sizeInBytes": 46116,
                                            "alt": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ],
                                            "title": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ]
                                        },
                                        {
                                            "path": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
                                            "name": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
                                            "extension": "webp",
                                            "mime": "image\/webp",
                                            "sizeInBytes": 158884,
                                            "alt": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ],
                                            "title": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "language": "pl_PL",
                                    "value": [
                                        {
                                            "path": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
                                            "name": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
                                            "extension": "webp",
                                            "mime": "image\/webp",
                                            "sizeInBytes": 46116,
                                            "alt": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ],
                                            "title": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ]
                                        },
                                        {
                                            "path": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
                                            "name": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
                                            "extension": "webp",
                                            "mime": "image\/webp",
                                            "sizeInBytes": 158884,
                                            "alt": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ],
                                            "title": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "language": "de_DE",
                                    "value": [
                                        {
                                            "path": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
                                            "name": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
                                            "extension": "webp",
                                            "mime": "image\/webp",
                                            "sizeInBytes": 46116,
                                            "alt": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ],
                                            "title": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ]
                                        },
                                        {
                                            "path": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
                                            "name": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
                                            "extension": "webp",
                                            "mime": "image\/webp",
                                            "sizeInBytes": 158884,
                                            "alt": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ],
                                            "title": [
                                                {
                                                    "language": "en_GB",
                                                    "value": null
                                                },
                                                {
                                                    "language": "pl_PL",
                                                    "value": null
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    }
                ]
            },
            "__typename": "SimpleProduct"
        }
    }
}

here