You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm following the documentation to use a custom fetch function, as I need to add authentication for accessing my GraphQL endpoint. I'm using the following codegen.ts file:
Which packages are impacted by your issue?
@graphql-codegen/cli
Describe the bug
I'm following the documentation to use a custom fetch function, as I need to add authentication for accessing my GraphQL endpoint. I'm using the following codegen.ts file:
and have a file called
myFetch.ts
in the same directory as thecodegen.ts
file that contains:Whenever I try and run the command:
npx graphql-codegen --config codegen.ts
I get the error:
This happens regardless of where I put the myFetch.ts file or how I organise the imports.
Your Example Website or App
https://github.com/linucks/gqlcodegen-customfetch
Steps to Reproduce the Bug or Issue
npx graphql-codegen --config codegen.ts
Expected behavior
I expected the myFetch.ts file to be found and the function imported and used or all fetches by graphql-codgen.
Screenshots or Videos
No response
Platform
@graphql-codegen/*
version(s): 5.0.3Codegen Config File
import type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
schema: "https://swapi-graphql.netlify.app/.netlify/functions/index",
documents: ["src/**/*.tsx"],
customFetch: "myFetch",
generates: {
"./src/gql/": {
preset: "client",
},
},
};
export default config;
Additional context
No response
The text was updated successfully, but these errors were encountered: