Skip to content

Provide new requestIsBatched field to gateway compatibility layer #7118

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 1 commit into from
Nov 3, 2022

Conversation

glasser
Copy link
Member

@glasser glasser commented Nov 2, 2022

This field was added today in v3.11.0 and v4.1.0. That means that if you
installed an older version of Gateway that gets its types from AS3
rather than from @apollo/server-gateway-interface it would suddenly
start expecting this field on its GraphQLRequestContext.

We fixed that problem by releasing v3.11.1 which makes the field
optional. But it still seems reasonable to provide it if it's
available... but we keep the field optional in the compatibility
interface so that new Gateway doesn't end up requiring new Server.

@glasser glasser requested a review from trevor-scheer November 2, 2022 22:43
@netlify
Copy link

netlify bot commented Nov 2, 2022

Deploy Preview for apollo-server-docs ready!

Name Link
🔨 Latest commit 6ccc138
🔍 Latest deploy log https://app.netlify.com/sites/apollo-server-docs/deploys/636315638cc89c00097e10d2
😎 Deploy Preview https://deploy-preview-7118--apollo-server-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 2, 2022

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 6ccc138:

Sandbox Source
Apollo Server Typescript Configuration
Apollo Server Configuration

@glasser
Copy link
Member Author

glasser commented Nov 2, 2022

@trevor-scheer Hmm. So the possible downside here is that this means you can't combine current Gateway with the version of ASGI that this would publish unless you're on v3.11 or v4.1.1, right? Is that a problem? Do we need to major bump ASGI or something?

@glasser
Copy link
Member Author

glasser commented Nov 2, 2022

Maybe that can be resolved by making the field optional in ASGI?

@trevor-scheer
Copy link
Contributor

Optional sounds like a nice solution but I'm not sure the types will be compatible if so. We could make all of them optional?

@glasser glasser force-pushed the glasser/requestisbatched-gateway branch from 3474454 to b304156 Compare November 3, 2022 01:10
@glasser
Copy link
Member Author

glasser commented Nov 3, 2022

OK, publishing #7119 (v3.11.1) actually fixes the failure, but it still seems reasonable to provide the data.

This field was added today in v3.11.0 and v4.1.0. That means that if you
installed an older version of Gateway that gets its types from AS3
rather than from `@apollo/server-gateway-interface` it would suddenly
start expecting this field on its GraphQLRequestContext.

We fixed that problem by releasing v3.11.1 which makes the field
optional. But it still seems reasonable to provide it if it's
available... but we keep the field optional in the compatibility
interface so that new Gateway doesn't end up requiring new Server.
@glasser glasser force-pushed the glasser/requestisbatched-gateway branch from b304156 to 6ccc138 Compare November 3, 2022 01:12
@glasser glasser merged commit c835637 into main Nov 3, 2022
@glasser glasser deleted the glasser/requestisbatched-gateway branch November 3, 2022 17:22
@github-actions github-actions bot mentioned this pull request Nov 3, 2022
glasser pushed a commit that referenced this pull request Nov 3, 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-gateway-interface@1.0.5

### Patch Changes

- [#7118](#7118)
[`c835637be`](c835637)
Thanks [@glasser](https://github.com/glasser)! - Provide new
`GraphQLRequestContext.requestIsBatched` field to gateways, because we
did add it in a backport to AS3 and the gateway interface is based on
AS3.

## @apollo/server-integration-testsuite@4.1.1

### Patch Changes

- Updated dependencies
\[[`c835637be`](c835637)]:
    -   @apollo/server@4.1.1

## @apollo/server@4.1.1

### Patch Changes

- [#7118](#7118)
[`c835637be`](c835637)
Thanks [@glasser](https://github.com/glasser)! - Provide new
`GraphQLRequestContext.requestIsBatched` field to gateways, because we
did add it in a backport to AS3 and the gateway interface is based on
AS3.

- Updated dependencies
\[[`c835637be`](c835637)]:
    -   @apollo/server-gateway-interface@1.0.5

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 19, 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