Skip to content

Type issue with QueryStringAddon and resolve #222

@jsardev

Description

@jsardev

I've been trying to create a reusable client with automatic expired token refresh.

Unfortunately, when adding the QueryStringAddon something's getting broken with the typings and I can't create a global resolve with unauthorized.

I'm getting this TS error:

The 'this' context of type 'Wretch<QueryStringAddon, unknown, undefined>' is not assignable to method's 'this' of type 'QueryStringAddon & Wretch<QueryStringAddon, unknown, undefined>'.
  Property 'query' is missing in type 'Wretch<QueryStringAddon, unknown, undefined>' but required in type 'QueryStringAddon'.(2684)

Here's a reproduction: https://stackblitz.com/edit/vitejs-vite-5per8h?file=src%2Fapi.ts

Would appreciate any help 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions