-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: Remove explicit return types from sdk methods #7592
Conversation
🦋 Changeset detectedLatest commit: df0e6e4 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/theguild/graphql-code-generator/7WYNTu7jFLy24t9NwnFiqy7zVnUB |
Hi @P4sca1, The For now, we should especially fix the |
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.
cf: #7592 (comment)
I agree, we should wait for |
Thank you @P4sca1! |
@P4sca1, is this PR still relevant? |
No, this one is no longer needed. |
Description
Previously, the return type of all SDK methods was declared manually. This can
cause the return type to become outdated when graphql-request gets updated.
This already happened, as graphql-request removed the errors attribute from the
return type (see graffle-js/graffle#174).
Also,
data
was marked as possibly undefined which is wrong.data
always existson a successful response (failed requests throw a
ClientError
).A sideeffect of this change is that the
extensionsType
config became obsoleteand has been removed. Because of this, I marked this change as a breaking change.
Type of change
I removed tests for the now removed
extensionsType
config and ranyarn test -u
. All tests are still passing. I also tested the change in a private project and did not experience any issues with the change.