graphql-code-generator-community
graphql-code-generator-community copied to clipboard
typescript-react-query custom fetcher not using correct import with near-operation-file
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",
}
}
}