-
-
Notifications
You must be signed in to change notification settings - Fork 579
Open
Labels
PRs welcomePRs are welcome to solve this issue!PRs are welcome to solve this issue!enhancementNew feature or requestNew feature or requestgood first issueStraightforward problem, solvable for first-time contributors without deep knowledge of the projectStraightforward problem, solvable for first-time contributors without deep knowledge of the projectopenapi-fetchRelevant to the openapi-fetch libraryRelevant to the openapi-fetch library
Description
I have the code with 2 api calls - one with "openapi-fetch" other with "openapi-react-query"
but only "openapi-react-query" have actual error on paths that didn't exist,
"openapi-fetch"generates the Type instantiation is excessively deep and possibly infinite.
Because of that vscode autocomplete didn't work in case with "openapi-fetch"
import type { paths } from "app/typings/__generated/api";
import createFetchClient from "openapi-fetch";
import createClient from "openapi-react-query";
export const fetchClient = createFetchClient<paths>({});
export const $api = createClient(fetchClient);
fetchClient.GET("/api/d");
// ^ Type instantiation is excessively deep and possibly infinite.
$api.useQuery("get", "/api/sdf");
// ^ Argument of type '"/api/sdf"' is not assignable to parameter of type 'PathsWithMethod<paths, "get">'
fetchClient.GET("/api/accessgroup");
// ^ Existing url works fine
$api.useQuery("get", "/api/accessgroup");
// ^ Existing url works fine
Flashantik, W2Wizard, vovsemenv, podkovyrovda and khiemtong
Metadata
Metadata
Assignees
Labels
PRs welcomePRs are welcome to solve this issue!PRs are welcome to solve this issue!enhancementNew feature or requestNew feature or requestgood first issueStraightforward problem, solvable for first-time contributors without deep knowledge of the projectStraightforward problem, solvable for first-time contributors without deep knowledge of the projectopenapi-fetchRelevant to the openapi-fetch libraryRelevant to the openapi-fetch library
Type
Projects
Status
Accepted