Closed
Description
Version: 2.0.0-beta.0
Hello, I'm having an issue inferring types when using createApi
from @reduxjs/toolkit/query/react
.
I get this issue with a very minimal setup.
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
/**
* `myApiReact` defaults to the `any` type producing the TypeScript error....
* The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.ts(7056)
*/
export const myApiReact = createApi({
reducerPath: "myApiReact",
baseQuery: fetchBaseQuery({
baseUrl: "/",
}),
endpoints: (builder) => ({
getData: builder.query<{}, string>({
query: (id) => `data/${id}`,
}),
}),
});
I can't find the cause of it yet. Seems like there's some type recursion happening somewhere in enhanceEndpoints
when the react module is used? Maybe someone has a better clue.
Metadata
Metadata
Assignees
Labels
No labels