Orderings sometimes does not work, Next.js

Hello, I am using the orderings to order the results by first publication date, however this works works in one my components and does not work in the other.

Here is the working one:

  const searchValue = query.v;
  const currentPage = query.page === 1 ? 1 : query.page;

  try {
    const postsData = await client.query(
      [
        Prismic.Predicates.at("document.type", "blog_post"),

        Prismic.Predicates.fulltext("document", searchValue),
      ],

      {
        orderings: "[my.blog_post.first_publication_date desc]",
        pageSize: 12,
        page: currentPage,
      }

    );

    return {
      props: { postsData, searchValue },
    };

  } catch (err) {
    console.error(err);
  }
}

Here is the one that does not work:

export const getStaticProps = async (context) => {

  const client = Client();
  const postsData = await client.query(
    Prismic.Predicates.at("document.type", "blog_post"),
    {
      orderings: "[my.blog_post.first_publication_date desc]",
      pageSize: 10,
    }
  );

  return {
    revalidate: 10,
    props: { postsData },
  };

};

Hi Kęstutis,

Welcome to the Prismic community,
I'm trying to reproduce this on my end and I will get back to you soon.

Fares

Thank you for the quick reply! I also wanted to add that the working example was inside of getServerSideProps function. Not sure if that changes anything, but thought it was important to mention.