Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dohomi opened this issue Aug 29, 2024 · 1 comment

Comments

@dohomi
Copy link

dohomi commented Aug 29, 2024

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

@dohomi
Copy link
Author

dohomi commented Aug 29, 2024

    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",
            }
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant