Skip to content
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

formatResponse: Fix typings and provide full request context. #3431

Merged
merged 4 commits into from
Oct 23, 2019

Conversation

abernix
Copy link
Member

@abernix abernix commented Oct 21, 2019

Previously, the formatResponse was only typed as a Function. However, since it's expected that the function return a GraphQLResponse (the same thing that it receives, that typing seems a bit too generic. This changes the typing to more accurately reflect the way it should be used, and also provides it the complete requestContext rather than just the cherry-picked context property.

Previously, this was only typed as a `Function`, which means we lost all the
typings on the return side of that method.
Comment on lines -388 to +391
{
context: requestContext.context,
},
requestContext,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that was easy 😄I read the PR and thought - "how's he gonna get out of that breaking change?" Interesting and convenient that this was passed in as an object before!

@abernix abernix merged commit 8059326 into master Oct 23, 2019
@abernix abernix deleted the abernix/adjust-formatResponse-typings branch October 23, 2019 07:13
glasser added a commit that referenced this pull request Apr 6, 2021
This typing was added in #3431; it looks like we put the `| null` in the wrong
place. Fortunately, a function that's OK with accepting a null argument and will
never return null can still typecheck with the new type.

Fixes #5009.
glasser added a commit that referenced this pull request Apr 6, 2021
This typing was added in #3431; it looks like we put the `| null` in the wrong
place. Fortunately, a function that's OK with accepting a null argument and will
never return null can still typecheck with the new type.

Fixes #5009.
glasser added a commit that referenced this pull request Apr 6, 2021
This typing was added in #3431; it looks like we put the `| null` in the wrong
place. Fortunately, a function that's OK with accepting a null argument and will
never return null can still typecheck with the new type.

Fixes #5009.
glasser added a commit that referenced this pull request Apr 6, 2021
This typing was added in #3431; it looks like we put the `| null` in the wrong
place. Fortunately, a function that's OK with accepting a null argument and will
never return null can still typecheck with the new type.

Fixes #5009.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants