# Typescript error in "orderings" param

**URL:** <https://community.prismic.io/t/typescript-error-in-orderings-param/19824>\
**Category:** Developing with Prismic\
**Tags:** typescript, nuxtjs\
**Created:** [June 19, 2025, 9:15am UTC](https://community.prismic.io/t/typescript-error-in-orderings-param/19824 "2025-06-19T09:15:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cerrutti](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/cerrutti/32/2908_2.png) [@cerrutti](https://community.prismic.io/u/cerrutti)\
**Post date:** [June 19, 2025, 9:15am UTC](https://community.prismic.io/t/typescript-error-in-orderings-param/19824/1 "2025-06-19T09:15:21Z")

</div>

Hi there,

I'm using Nuxt 3, and I'm getting a Typescript warning when apply new "orderings" param to my requests.

As far as I know, orderings was like this:

```auto
{
  orderings: '[my.post.date desc]'
}

```

But now it's an array:

```auto
{
  orderings: [
    { field: 'my.post.date', direction: 'desc' }
  ]
}

```

Well, I'm gettings this warning from Typescript:

```auto
Argument of type '{ fetchLinks: string; lang: "es-ES" | "en-EU"; orderings: { field: string; direction: string; }[]; page: number; pageSize: any; filters: any[]; }' is not assignable to parameter of type 'Partial<BuildQueryURLArgs> & FetchParams'.
  Type '{ fetchLinks: string; lang: "es-ES" | "en-EU"; orderings: { field: string; direction: string; }[]; page: number; pageSize: any; filters: any[]; }' is not assignable to type 'Partial<BuildQueryURLArgs>'.
    Types of property 'orderings' are incompatible.
      Type '{ field: string; direction: string; }[]' is not assignable to type 'string | Ordering | (string | Ordering)[] | undefined'.
        Type '{ field: string; direction: string; }[]' is not assignable to type '(string | Ordering)[]'.
          Type '{ field: string; direction: string; }' is not assignable to type 'string | Ordering'.
            Type '{ field: string; direction: string; }' is not assignable to type 'Ordering'.
              Types of property 'direction' are incompatible.
                Type 'string' is not assignable to type '"desc" | "asc" | undefined'.ts-plugin(2345)
const postsParams: {
    fetchLinks: string;
    lang: "es-ES" | "en-EU";
    orderings: {
        field: string;
        direction: string;
    }[];
    page: number;
    pageSize: any;
    filters: any[];
}

```

Looks like some type is not updated, right?

Thank you.

---

<div class="post-metadata">

**Author:** ![lihbr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/lihbr/32/7409_2.png) [@lihbr](https://community.prismic.io/u/lihbr)\
**Post date:** [June 20, 2025, 11:15am UTC](https://community.prismic.io/t/typescript-error-in-orderings-param/19824/2 "2025-06-20T11:15:14Z")

</div>

Hi @cerrutti,

Both orderings methods your share are valid today as of `@prismicio/client` v7, with the former (string based) being deprecated.

I tried to reproduce your type issue on Nuxt with no luck: [Prismic Minimal Example - StackBlitz](https://stackblitz.com/edit/github-qu6dly3q?file=package.json)

According to the snippet you shared (`postsParams`), if you're abstracting client parameters into a constant, then, you'll need to cast direction (`"asc" as const` or `variable as "asc" | "desc"`) for TypeScript to stop showing an error. I don't think this is a recent change on our end as direction has been typed like this for a few years now 🤔

Could you share the versions of `nuxt`, `@nuxtjs/prismic`, `typescript` so we can try to troubleshoot your issue?
