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

Fix v4 regression: gateways should be able to set HTTP response metadata #7071

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

glasser
Copy link
Member

@glasser glasser commented Oct 24, 2022

The shim layer between AS4 and Gateway (which creates an argument for the Gateway's executor which looks like AS3's GraphQLRequestContext) did not copy changes to response headers or HTTP status back to the real GraphQLRequestContext. This PR makes the shimmed HTTP response object use the real response objects as backing storage.

Fixes #7069.

The shim layer between AS4 and Gateway (which creates an argument for
the Gateway's executor which looks like AS3's GraphQLRequestContext) did
not copy changes to response headers or HTTP status back to the real
GraphQLRequestContext. This PR makes the shimmed HTTP response object
use the real response objects as backing storage.

Fixes #7069.
@netlify
Copy link

netlify bot commented Oct 24, 2022

Deploy Preview for apollo-server-docs failed.

Name Link
🔨 Latest commit 58ee4b0
🔍 Latest deploy log https://app.netlify.com/sites/apollo-server-docs/deploys/63572677824e5d0008b130de

@glasser glasser enabled auto-merge (squash) October 24, 2022 23:57
@glasser glasser merged commit 0ed389c into main Oct 24, 2022
@glasser glasser deleted the glasser/gateway-regression-7069 branch October 24, 2022 23:58
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 58ee4b0:

Sandbox Source
Apollo Server Typescript Configuration
Apollo Server Configuration

@github-actions github-actions bot mentioned this pull request Oct 24, 2022
glasser pushed a commit that referenced this pull request Oct 25, 2022
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @apollo/server-integration-testsuite@4.0.3

### Patch Changes

- [#7073](#7073)
[`e7f524eac`](e7f524e)
Thanks [@glasser](https://github.com/glasser)! - Never interpret `GET`
requests as batched. In previous versions of Apollo Server 4, a `GET`
request whose body was a JSON array with N elements would be interpreted
as a batch of the operation specified in the query string repeated N
times. Now we just ignore the body for `GET` requests (like in Apollo
Server 3), and never treat them as batched.

- [#7071](#7071)
[`0ed389ce8`](0ed389c)
Thanks [@glasser](https://github.com/glasser)! - Fix v4 regression:
gateway implementations should be able to set HTTP response headers and
the status code.

- Updated dependencies
\[[`e7f524eac`](e7f524e),
[`0ed389ce8`](0ed389c)]:
    -   @apollo/server@4.0.3

## @apollo/server@4.0.3

### Patch Changes

- [#7073](#7073)
[`e7f524eac`](e7f524e)
Thanks [@glasser](https://github.com/glasser)! - Never interpret `GET`
requests as batched. In previous versions of Apollo Server 4, a `GET`
request whose body was a JSON array with N elements would be interpreted
as a batch of the operation specified in the query string repeated N
times. Now we just ignore the body for `GET` requests (like in Apollo
Server 3), and never treat them as batched.

- [#7071](#7071)
[`0ed389ce8`](0ed389c)
Thanks [@glasser](https://github.com/glasser)! - Fix v4 regression:
gateway implementations should be able to set HTTP response headers and
the status code.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 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.

AS4 regression: cannot set HTTP headers or status from gateway
1 participant