saleor / saleor-storefront

A GraphQL-powered, NextJs-based, PWA storefront for Saleor. IMPORTANT: This project is [DEPRECATED] in favor of saleor/react-storefront soon to become our default demo and storefront starter pack.
https://demo.saleor.io/
BSD 3-Clause "New" or "Revised" License
769 stars 672 forks source link

Bug on loading products by page #719

Closed waelbettayeb closed 2 years ago

waelbettayeb commented 4 years ago

What I'm trying to achieve

Loading products per page when sortBy isn't setted

Steps to reproduce the problem

  1. Load all products on category, search or collection
  2. SortBy must be clear...
  3. Try to load all the product

What I expected to happen

All the products must be loaded

EDIT: Not all pages are loaded

krzysztofwolski commented 4 years ago

Cant reproduce. My try:

https://demo.saleor.io/category/homewares/22/?filters=cushion-size_55cm-x-55cm

request have sortBy set to null: image

response body:
``` [ { "data":{ "products":{ "totalCount":2, "edges":[ { "node":{ "id":"UHJvZHVjdDo4NQ==", "name":"Colored Parrot Cushion", "thumbnail":{ "url":"https://pwa.demo.saleor.rocks/media/__sized__/products/saleordemoproduct_cuschion01-thumbnail-255x255.png", "alt":"", "__typename":"Image" }, "thumbnail2x":{ "url":"https://pwa.demo.saleor.rocks/media/__sized__/products/saleordemoproduct_cuschion01-thumbnail-510x510.png", "__typename":"Image" }, "__typename":"Product", "pricing":{ "onSale":false, "priceRangeUndiscounted":{ "start":{ "gross":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "net":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "__typename":"TaxedMoney" }, "stop":{ "gross":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "net":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "__typename":"TaxedMoney" }, "__typename":"TaxedMoneyRange" }, "priceRange":{ "start":{ "gross":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "net":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "__typename":"TaxedMoney" }, "stop":{ "gross":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "net":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "__typename":"TaxedMoney" }, "__typename":"TaxedMoneyRange" }, "__typename":"ProductPricingInfo" }, "category":{ "id":"Q2F0ZWdvcnk6MjI=", "name":"Homewares", "__typename":"Category" } }, "__typename":"ProductCountableEdge" }, { "node":{ "id":"UHJvZHVjdDo4Ng==", "name":"White Parrot Cushion", "thumbnail":{ "url":"https://pwa.demo.saleor.rocks/media/__sized__/products/saleordemoproduct_cuschion02-thumbnail-255x255.png", "alt":"", "__typename":"Image" }, "thumbnail2x":{ "url":"https://pwa.demo.saleor.rocks/media/__sized__/products/saleordemoproduct_cuschion02-thumbnail-510x510.png", "__typename":"Image" }, "__typename":"Product", "pricing":{ "onSale":false, "priceRangeUndiscounted":{ "start":{ "gross":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "net":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "__typename":"TaxedMoney" }, "stop":{ "gross":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "net":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "__typename":"TaxedMoney" }, "__typename":"TaxedMoneyRange" }, "priceRange":{ "start":{ "gross":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "net":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "__typename":"TaxedMoney" }, "stop":{ "gross":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "net":{ "amount":20.0, "currency":"USD", "__typename":"Money" }, "__typename":"TaxedMoney" }, "__typename":"TaxedMoneyRange" }, "__typename":"ProductPricingInfo" }, "category":{ "id":"Q2F0ZWdvcnk6MjI=", "name":"Homewares", "__typename":"Category" } }, "__typename":"ProductCountableEdge" } ], "pageInfo":{ "endCursor":"WyJXaGl0ZSBQYXJyb3QgQ3VzaGlvbiJd", "hasNextPage":false, "hasPreviousPage":false, "startCursor":"WyJDb2xvcmVkIFBhcnJvdCBDdXNoaW9uIl0=", "__typename":"PageInfo" }, "__typename":"ProductCountableConnection" }, "category":{ "seoDescription":"", "seoTitle":"", "id":"Q2F0ZWdvcnk6MjI=", "name":"Homewares", "backgroundImage":{ "url":"https://pwa.demo.saleor.rocks/media/category-backgrounds/accessories.jpg", "__typename":"Image" }, "ancestors":{ "edges":[ { "node":{ "id":"Q2F0ZWdvcnk6Nw==", "name":"Accessories", "__typename":"Category" }, "__typename":"CategoryCountableEdge" } ], "__typename":"CategoryCountableConnection" }, "__typename":"Category" }, "attributes":{ "edges":[ { "node":{ "id":"QXR0cmlidXRlOjIy", "name":"Size", "slug":"cushion-size", "values":[ { "id":"QXR0cmlidXRlVmFsdWU6NzA=", "name":"45cm x 45cm", "slug":"45cm-x-45cm", "__typename":"AttributeValue" }, { "id":"QXR0cmlidXRlVmFsdWU6NzE=", "name":"55cm x 55cm", "slug":"55cm-x-55cm", "__typename":"AttributeValue" } ], "__typename":"Attribute" }, "__typename":"AttributeCountableEdge" }, { "node":{ "id":"QXR0cmlidXRlOjIz", "name":"Material", "slug":"material", "values":[ { "id":"QXR0cmlidXRlVmFsdWU6NzI=", "name":"Cotton", "slug":"cotton", "__typename":"AttributeValue" }, { "id":"QXR0cmlidXRlVmFsdWU6NzM=", "name":"Elastane", "slug":"elastane", "__typename":"AttributeValue" }, { "id":"QXR0cmlidXRlVmFsdWU6NzQ=", "name":"Polyester", "slug":"polyester", "__typename":"AttributeValue" } ], "__typename":"Attribute" }, "__typename":"AttributeCountableEdge" } ], "__typename":"AttributeCountableConnection" } } } ] ```

@wael-mohamed can you provide more data how error can be reproduced?