Skip to content

Issue when using esModuleInterop option #119

@tsiege

Description

@tsiege

I'm running into an issue with the orderBy statement on a query. Fairly certain this is a bug with the type definitions since the code works correctly and is cribbed from the examples. I've looked for an enum to no avail, but I don't think I should need it since the definition uses a Union type called OrderByDirection.

The following code results in this error

        return client.models.Post.findMany()
          .orderBy([{ publishedAt: 'DESC' }])
          .resolveInfo(info)
          .execute()
Type 'string' is not assignable to type '("ASC" & { [x: string]: "ASC" | "DESC" | undefined; }) | ("ASC" & { sum?: { [x: string]: "ASC" | "DESC" | undefined; } | undefined; avg?: { [x: string]: "ASC" | "DESC" | undefined; } | undefined; min?: { ...; } | undefined; max?: { ...; } | undefined; } & { ...; }) | ("DESC" & { ...; }) | ("DESC" & ... 1 more ... & ...'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions