graphql-code-generator
graphql-code-generator copied to clipboard
customFetch type should allow for function to be passed in
Is your feature request related to a problem? Please describe.
I noticed that the type for CodegenConfig only allows for the string of a module to be passed in for customFetch when graphql-tools loader which is being used to resolve this property also allows for a function.
Describe the solution you'd like
Can we make customFetch a union of either string or a function that returns a promise?
customFetch?: string | ((query: RequestInfo, options: RequestInit) => Promise<Response>);
This would also make the expected inputs / outputs of this function more clear for developers regardless of type they use. I have a PR of this change locally with updated docs / tests.
Describe alternatives you've considered
No response
Is your feature request related to a problem? Please describe.
No response
Having the same issue