skip to Main Content

in my Node project I am fetching articles from shopify app.
Code:

await shopify.article.list(blockId, { limit: 2 });

Now here I am getting both published/unpublished articles. I only want to fetch published articles.
Can you suggest me, which params I need to pass to fetch only published articles?

Thanks in advance.

2

Answers


  1. Chosen as BEST ANSWER

    Doing this solved my issue:

    await shopify.article.list(blogId, {
      limit: 2,
      published_status: 'published'
    });
    

    github: https://github.com/MONEI/Shopify-api-node/issues/537
    shopify: https://shopify.dev/api/admin-rest/2022-04/resources/article#get-blogs-blog-id-articles


  2. Did you know you can filter by asking for only published articles? It is an amazing thing.

    published_status: "published"
    

    So that ensures your GET articles just returns published articles. Amazing!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search