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

{% hint style="info" %}
This approach can be helpful if you do not use the "first" argument or records in a stream that exceeded 200.
{% endhint %}

{% hint style="info" %}
Please take note that the cursor is a string, therefore needs to be put in quotes.
{% endhint %}

{% hint style="info" %}
To understand what streams and cursors are, please refer to the "Query types" article in the "Overview" section on this page.
{% endhint %}

```graphql
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
    optionList(first: 10) {
      edges {
        node {
          code
          name(languages: ["en_US"]) {
            value
            language
          }
        }
      }
    }
  }
  variantList {
    ...ProductConnection
  }
}

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

fragment Attribute on Attribute {
  code
  name(languages: ["en_US"]) {
    value
    language
  }
  scope
}

fragment Product on Product {
  __typename
  sku
  createdAt
  editedAt
}

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

{% hint style="info" %}
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.
{% endhint %}

```graphql
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
    }
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ergonode.com/graphql/query-examples/list-of-grouped-products-with-simple-and-variable-products-after-some-end-cursor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
