-
Notifications
You must be signed in to change notification settings - Fork 184
CODEGEN-792 - @graphql-codegen/graphql-request - Allow signal request options #1116
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@graphql-codegen/typescript-graphql-request': minor | ||
| --- | ||
|
|
||
| Allow sending signal as the 3rd param in each SDK call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you familiar with how the generated SDK work, and could help me do a sense check please @jasonkuhrt?
Given a doc like this:
Currently, it's generating a function that takes in
variablesandrequestHeadersas positional params, then usesclient.request's positional param like this:This PR changes it to use single object param like this:
2 questions from me:
graphql-request@7, I can see that there are only 4 possible keuys for the object style, is this correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, not familiar with this generator myself. IIUC your object there with 4 keys is I guess correct. I would trust whatever the TS types say. Its weird to me that signal gets shoved in there but I suspect it was added just to unblock people and keep things moving at some point.
In terms of issues with approach, hard for me to say having been distant from v7 for a while and not familiar with this generator so can't help much off hand with that. But if you make a quick test and it seems to be working, then that's a decent confirmation that it should be working in other cases too.
Sorry to not be more helpful!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jasonkuhrt ! All good! Appreciate the context and advices.
I've done a few tests and it's working fine, will merge this 🙏