From 938aaee57fa2c0c7495ca777cad668fe2d47a3b8 Mon Sep 17 00:00:00 2001 From: Harry Duong Date: Tue, 20 Sep 2022 03:24:21 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20allway=20import=20custom=20f?= =?UTF-8?q?etcher=20as=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/typescript/react-query/src/fetcher-custom-mapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugins/typescript/react-query/src/fetcher-custom-mapper.ts b/packages/plugins/typescript/react-query/src/fetcher-custom-mapper.ts index 4399f5f173f..20bc48e907a 100644 --- a/packages/plugins/typescript/react-query/src/fetcher-custom-mapper.ts +++ b/packages/plugins/typescript/react-query/src/fetcher-custom-mapper.ts @@ -32,7 +32,7 @@ export class CustomMapperFetcher implements FetcherRenderer { asDefault: this._mapper.default, }, ], - this.visitor.config.useTypeImports + false ); } From 80b4a7849076e2d77a984921be5011b31f5a8d88 Mon Sep 17 00:00:00 2001 From: Harry Duong Date: Tue, 27 Sep 2022 15:29:04 +0700 Subject: [PATCH 2/2] update test case --- .../plugins/typescript/react-query/tests/react-query.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugins/typescript/react-query/tests/react-query.spec.ts b/packages/plugins/typescript/react-query/tests/react-query.spec.ts index e2c97acd2fa..8ac1c8b1604 100644 --- a/packages/plugins/typescript/react-query/tests/react-query.spec.ts +++ b/packages/plugins/typescript/react-query/tests/react-query.spec.ts @@ -391,7 +391,7 @@ export const useTestMutation = < const out = (await plugin(schema, docs, config)) as Types.ComplexPluginOutput; - expect(out.prepend).toContain(`import type { customFetcher } from './my-file';`); + expect(out.prepend).toContain(`import { customFetcher } from './my-file';`); }); it("Should generate fetcher field when exposeFetcher is true and the fetcher isn't a react hook", async () => {