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

List of grouped products with simple and variable products AFTER some end cursor

This is how you can get data after some cursor via API.

This approach can be helpful if you do not use the "first" argument or records in a stream that exceeded 200.

Please take note that the cursor is a string, therefore needs to be put in quotes.

To understand what streams and cursors are, please refer to the "Query types" article in the "Overview" section on this page.

query groupingProduct {
  productStream(after: "YXJyYXljb25uZWN0aW9uOjM2MTE=") {
    ... ProductConnection
    edges {
      node {
        ... on GroupingProduct {
          ... Product
          childrenList {
            pageInfo {
              hasNextPage
              endCursor
            }
            edges {
              node {
                quantity
                product {
                  ... SimpleProduct
                  ... VariableProduct
                }
              }
            }
          }
        }
        template {
          code
        }
      }
    }
  }
}

fragment SimpleProduct on SimpleProduct {
  ... Product
  attributeList {
    ... AttributeValueConnection
  }
}

fragment VariableProduct on VariableProduct {
  ... Product
  attributeList {
    ... AttributeValueConnection
  }
  bindings {
    ... Attribute
    options {
      code
      name {
        value
        language
      }
    }
  }
  variantList {
    ... ProductConnection
  }
}

fragment AttributeValueConnection on AttributeValueConnection {
  pageInfo {
    hasNextPage
    endCursor
  }
  edges {
    node {
      attribute {
        ... Attribute
      }
      translations {
        language
      }
    }
  }
}

fragment Attribute on Attribute {
  code
  name {
    value
    language
  }
  scope
}

fragment Product on Product {
  __typename
  sku
  createdAt
  editedAt
}

fragment ProductConnection on ProductConnection {
  pageInfo {
    hasNextPage
    endCursor
  }
  edges {
    node {
      ... Product
    }
  }
}

It's also possible to use both "after" and "first" arguments in one query. Example below will return 100 records (if they exist), that are after endCursor in productStream.

query groupingProduct {
  productStream(after: "YXJyYXljb25uZWN0aW9uOjM2MTE=", first: 100) {
    ... ProductConnection
    edges {
      node {
        ... on GroupingProduct {
          ... Product
          childrenList {
            pageInfo {
              hasNextPage
              endCursor
            }
            edges {
              node {
                quantity
                product {
                  ... SimpleProduct
                  ... VariableProduct
                }
              }
            }
          }
        }
        template {
          code
        }
      }
    }
  }
}

fragment SimpleProduct on SimpleProduct {
  ... Product
  attributeList {
    ... AttributeValueConnection
  }
}

fragment VariableProduct on VariableProduct {
  ... Product
  attributeList {
    ... AttributeValueConnection
  }
  bindings {
    ... Attribute
    options {
      code
      name {
        value
        language
      }
    }
  }
  variantList {
    ... ProductConnection
  }
}

fragment AttributeValueConnection on AttributeValueConnection {
  pageInfo {
    hasNextPage
    endCursor
  }
  edges {
    node {
      attribute {
        ... Attribute
      }
      translations {
        language
      }
    }
  }
}

fragment Attribute on Attribute {
  code
  name {
    value
    language
  }
  scope
}

fragment Product on Product {
  __typename
  sku
  createdAt
  editedAt
}

fragment ProductConnection on ProductConnection {
  pageInfo {
    hasNextPage
    endCursor
  }
  edges {
    node {
      ... Product
    }
  }
}
PreviousList of 100 grouped products with simple and variable products in streamNextList of active languages

Last updated 1 year ago

Was this helpful?