How can I request all products using the query allProducts?
The productsearch returns a maximum of 10.000 products for a search. Use the query allProducts to retrieve all products from a DistributionGate.
Written by Mark Schaper
Updated over
12 hours ago
Structure of the query
query q1 {
allProducts(size: 100, distributionChannelId: 83, state: ACTIVE, lastModifiedAfter: "2021-03-01T12:08:55+02:00", scrollId: null) {
scrollId
content {
id
}
}
}
- size: Products per page.
- distributionChannelId: The ID of your DistributionChannel, provided by ProMaterial.
state: Return products with a specific state (ACTIVE | DELETED).
- lastModifiedAfter: Return products that where changed after a certain date and time. Time stamp is a ISO8601-formatted string.
- scrollId: In the first request, omit the scrollId. In the response a scrollId of type string is returned. Use the scrollId of the response in the following request.
You are finished, when the content array is empty.
Did this answer your question?