dotansimha/graphql-code-generator-community

typescript-react-query custom fetcher not using correct import with near-operation-file

Opened this issue · 1 comments

Is your feature request related to a problem? Please describe.

Using near-oparation-file has a wrong import using custom fetcher.

Describe the solution you'd like

The path should be correct.

Describe alternatives you've considered

Using typescript alias path fixes it but might be an easier fix within the plugin

    generates: {
        "./src/utils/__generated__/types.ts": {
            documents: ['src/**/*.gql'],
            plugins: ["typescript", "typescript-operations"],
            config: {
                dedupeFragments: true,
             }
        },
        "src/": {
            preset: "near-operation-file",
            documents: ['src/**/*.gql'],
            plugins: ["typescript-react-query"],
            config: {
                fetcher: {
                    func: "@gql-fetcher#fetchData", // this is always a fixed path and not a relative path
                    isReactHook: false
                },
                reactQueryVersion: 5,
                dedupeFragments: true,
                importOperationTypesFrom: "Types",
            }
        }
    }