Skip to content

v0.15.0: Remove QueryClientLike interface

Choose a tag to compare

@zedrdave zedrdave released this 24 Feb 12:54
· 39 commits to main since this release
36e1117

Breaking Change

Removed QueryClientLike interface - use QueryClient directly from @tanstack/vue-query.

Changes

Changed

  • createApiClient() now accepts QueryClient from @tanstack/vue-query instead of QueryClientLike
  • Eliminates need for type casts like as any when creating API clients
  • Internal casts removed from openapi-query.ts and openapi-mutation.ts
  • Updated EndpointConfig.queryClient to use QueryClient type

Removed

  • QueryClientLike interface from public API exports
  • Internal as QueryClient type casts

Added

  • Comprehensive typing and regression tests to prevent QueryClient casting issues
    • Runtime tests in tests/bugfix/queryclient-no-cast.test.ts (5 tests)
    • Type compatibility tests in tests/bugfix/queryclient-types.test.ts (3 tests)

Migration

  1. Remove any as any or as QueryClient type casts when calling createApiClient
  2. Regenerate API clients to get updated type signatures
  3. If using QueryClientLike type directly, replace with QueryClient from @tanstack/vue-query

Example

// Before
const api = createApiClient(axios, queryClient as any)

// After
const api = createApiClient(axios, queryClient)