[typescript-graphql-request] Allow passing Abortsignal to graphql-request
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Related #31
Type of change
- [x] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
- repository tests
Checklist:
- [x] I have followed the CONTRIBUTING doc and the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
I moved this pr from the main repo, but have not yet tested the version of this code in any private repo. If you have some time @yemi you can test the code from this pr. Thank you.
hey @ardatan @vadimdemedes sorry it took me longer than expected to get back to this.
I wanted to avoid pushing anything that i did not at least test once inside an example repo. While following the getting started of new client preset of GraphQL codegen, I noticed that generating any library-specific code is not advised anymore and instead only TypedDocumentNode should be used.
TLDR:
The codegen approach of this plugin is deprecated. Therefore, I don't know if it even makes sense to update it.
Here is an example repo & stackblitz where I tested passing the Abortsignal to graphql-request from tanstack/query with the new graphql-codegen/client-preset
Will keep this pr open to wait for feedback
Hey, I took another look at the options that graphql-options allows. As you can see, headers & signal are the only options allowed. If we want to pass any other options from RequestInit to it, we need to open a pr for graphql-request.
Test repo with this pr repo & stackblitz
any update on this?
any update on this?
@mp205 From my side, the pr is ready for review/merge. As mentioned in my comment here, I don't know how relevant it still is as graphql-codegen does advise against generating lib-specific code and instead to use TypedDocumentNodes.
And as mentioned in this comment , the proposed changes by @ardatan & @vadimdemedes are not possible as graphql-request only allows passing signal and headers to it instead of the Dom.RequestInit as a whole.
Hello, Just would like to know will the PR be merged anytime soon. cc: @shkreios @ardatan
Hi, is there any updates regarding this MR? This feature would be crucial to my current project.
@ardatan, @vadimdemedes Hi, can you help to let this be merged ?
I am checking in here to see if we plan to merge this. @shkreios @ardatan