You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: When querying products using GraphQL with pagination (hasNextPage is true), subsequent requests using endCursor as the after variable return repeated results instead of unique products. Despite hasNextPage being true, the results loop over the same products, preventing successful data retrieval beyond the first set.
Reproduction Steps:
1- Run the GraphQL query for products with the first set to 100 (42 results returned by query).
2- Use endCursor from the response for the after variable.
3- Observe that results repeat.
Expected Behavior: Unique products should be fetched on each subsequent request until hasNextPage is false.
query GetProducts( $first: Int! $after: String $taxonomyFilter: ProductTaxonomyInput ) { products( first: $first after: $after where: { taxonomyFilter: $taxonomyFilter } ) { edges { node { ... on SimpleProduct { id databaseId name sku price stockStatus productCategories { nodes { id databaseId name } } attributes(where: { type: GLOBAL }) { nodes { attributeId options name } } galleryImages { nodes { id altText sourceUrl } } slug } } } pageInfo { hasNextPage hasPreviousPage startCursor endCursor } } }
Description: When querying products using GraphQL with pagination (hasNextPage is true), subsequent requests using endCursor as the after variable return repeated results instead of unique products. Despite hasNextPage being true, the results loop over the same products, preventing successful data retrieval beyond the first set.
Reproduction Steps:
1- Run the GraphQL query for products with the first set to 100 (42 results returned by query).
2- Use endCursor from the response for the after variable.
3- Observe that results repeat.
Expected Behavior: Unique products should be fetched on each subsequent request until hasNextPage is false.
query GetProducts( $first: Int! $after: String $taxonomyFilter: ProductTaxonomyInput ) { products( first: $first after: $after where: { taxonomyFilter: $taxonomyFilter } ) { edges { node { ... on SimpleProduct { id databaseId name sku price stockStatus productCategories { nodes { id databaseId name } } attributes(where: { type: GLOBAL }) { nodes { attributeId options name } } galleryImages { nodes { id altText sourceUrl } } slug } } } pageInfo { hasNextPage hasPreviousPage startCursor endCursor } } }
and the input
{ "first": 100, "after": "xxxxxxxxxxxxx", "taxonomyFilter": { "relation": "AND", "filters": [ { "taxonomy": "PA_BRAND", "terms": ["Toyota"], "operator": "IN" }, { "taxonomy": "PA_MODEL", "terms": ["Camry"], "operator": "IN" }, { "taxonomy": "PA_PRODUCTION_YEAR", "terms": ["2015", "2016", "2017"], "operator": "IN" } ] } }
The text was updated successfully, but these errors were encountered: