Issues with GraphQL

Using this example:

        query {
            products(first: 5, query: "title:Free Gratis") {
                edges {
                    node {
                        id
                        title
                        variants (first: 50, query: "__title:*sticker*__") {
                            edges {
                                node {
                                    id
                                    sku
                                    title
                                }
                            }
                        }
                    }
                }
            }
        }
  1. It’s unclear how the products “subquery” works (title:“Free Gratis”). Isn’t that supposed to find “Free” or “Gratis” anywhere in the title?

  2. The variants subquery (title:sticker) doesn’t work at all.

Does anyone have a working example of filtering certain products by title and variants by title?

Hi,there

if you need to query “Free” or “Gratis” , change the query to

 products(first: 5, query: "title:Free OR title:Gratis")

Regarding the variants filter, I don’t think there is direct support for filtering by title in the query argument. Instead, you need to retrieve all variants and then filter them through your program. you can refer the doc

Thank you!

Regarding the variants filter, I don’t think there is direct support for filtering by title in the query argument. Instead, you need to retrieve all variants and then filter them through your program. you can refer the doc

It definitely does support that. Both sku and title are in the query section of the documentation.

Furthermore, title works with wildcards but sku is broken and does not. This seems to be a major problem with the GraphQL API, which is neither consistent nor predictable.

you can see the pic no query param at all , this is not the product input obj param.

I’m looking at queries. I don’t think connections is relevant.