-
Notifications
You must be signed in to change notification settings - Fork 307
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
Allow passing more options to fetch #6
Comments
The idea looks reasonable, however I wonder how to deal with the @IvanGoncharov @RomanGotsiy any feedback here? |
@schickling this sounds reasonable. Something like this: const response = await fetch(this.url, {
method: 'POST',
...this.options, // to allow overwrite method but merge headers and ignore body
headers: Object.assign({'Content-Type': 'application/json'}, this.options.headers),
body,
}) |
Sounds good! Does somebody want to create a PR + some tests for this? |
I can make a PR on weekends if nobody creates it earlier |
First, thank you for the awesome work!
Currently the library seems to be only pass the headers option to fetch whilst fetch takes many more options like
I'm not that familiar with typescript to make a quick pull request without messing things up, but perhaps keeping all the passed in options at https://github.com/graphcool/graphql-request/blob/master/src/index.ts#L18 and something like
at https://github.com/graphcool/graphql-request/blob/master/src/index.ts#L30.
The text was updated successfully, but these errors were encountered: