What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Filtering via GraphQl not showing all products

Filtering via GraphQl not showing all products

stefansdev
Shopify Partner
2 0 0

Hi,

We started having issues couple days ago with a graphql query for retrieving  products from collection, with a filter for tag. Worked properly before.

It doesnt return all products, but just one of 10. I checked 5 times that products are in correct sales channel, and tagged correctly. Products are identical, except title, handle, price, images, description.

On top of this we have "Search & Discovery" app installed, so we can filter properly. When it's turned off, it returns all shop products. 

 

Could this be a bug or something else is needed (like "search and discovery" app)  ? Any tips ? 

 

query ($handle: String, $tag: String) {
  collection(handle: $handle) {
    title
    handle
    products(first: 100, filters: {tag: $tag}) {
      edges {
        node {
          handle
          title
        }
      }
      pageInfo {
        hasNextPage
        endCursor
        hasPreviousPage
        startCursor
      }
    }
  }
}

 



Thanks,
Stefan

stefans.dev
Full Stack JS Dev, specialized in Jamstack and Headless
Reply 1 (1)

stefansdev
Shopify Partner
2 0 0

This has been solved by itself. Im not sure why yet, seems like some shopify internal cache. It's not on our side, I made sure I was testing inside shopify graphql app too.

stefans.dev
Full Stack JS Dev, specialized in Jamstack and Headless