Confusion on products published status

I am writing a query to fetch all products that are currently active and published on the Online store. The .dev assistant has built this query:

query GetActivePublishedProducts {
  products(first: 10, query: "status:active AND published_status:published") {
    edges {
      node {
        id
        title
        handle
        status
       ...
      }
    }
  }
}

However, when I run it on the current API version, I am getting some warnings on my query filter:

...
"search": [
            {
                "path": [
                    "products"
                ],
                "query": "status:active AND published_status:published",
                "parsed": {
                    "and": [
                        {
                            "field": "status",
                            "match_all": "active"
                        },
                        {
                            "field": "published_status",
                            "match_all": "published"
                        }
                    ]
                },
                "warnings": [
                    {
                        "field": "published_status",
                        "message": "Input `published` is not an accepted value."
                    }
                ]
            }
        ]
...

Looking at the query filters just makes me even more confused, because I am getting different numbers with each filter I use (publishable_status, published_status, product_publication_status… :face_with_spiral_eyes:). What is the proper term to use here without getting any warnings?

1 Like

Hi, checking the docs I believe you should be using publishable_status and not published_status, it is a bit confusing in the docs and very easy to miss.

1 Like

Thank you for the response. Trying out published_status:published brings back 30 results for me, while the publishable_status:published or publishable_status:online_store_channel brings back 35. What could be the difference here? I checked the products page on my admin dashboard and by filtering with status active and included in online store sales channel, I confirmed that the correct answer is indeed 30. The 5 that are most definitely not included in the online store sales channel, are being returned in the query with the publishable_status:published filter. I am using the 2025-01 version.

Hello!

Apologies for the confusion. Your query is correct, I’ve informed the team who will get this documentation/warning updated accordingly.

Thank you for raising this.

1 Like

That’s great. Thank you for bringing it to their attention :greece:

1 Like

Hi there,

I see that this issue has been marked as solved, but I think it should not be solved until it is well documented. For now, the published_status:published filter is not documented at products - GraphQL Admin. The published option is not a valid value according to the current documentation, and it is however working perfectly.

Please could you update the documentation and add the published filter value option?

Also, I noticed that the product_publication_status features a wrong example:

And the published_status filter still lacks the published value:

Nevertheless, you are right, I am going to let a Shopify Staff user mark it as resolved when the documentation is updated.

(source is products - GraphQL Admin)

2 Likes

In fact, we can see the following warning in the Graphiql app, although it has been shown in this thread that the published_status:published query filter is accepted and works.

In addition to updating the documentation at products - GraphQL Admin, could you please take a look at the Graphiql app?