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.2.0 regression in variables: null (et al) #7203

Merged
merged 1 commit into from Nov 28, 2022

Conversation

glasser
Copy link
Member

@glasser glasser commented Nov 28, 2022

In v4.2.0 (#7171) we changed POST handling to be stricter if operationName, variables, or extensions were provided with a surprising data type. This was intended to pass more of the optional recommendations of the GraphQL Over HTTP spec as tested by the graphql-http audit suite. However, we were overzealous and also banned providing these parameters as an explicit null, which is documented by the spec as legitimate. (And some clients, such as FIXME, actually send variables: null in practice.)

We added explicit tests for this to the graphql-http test suite (graphql/graphql-http#28) and this commit allows these nulls again.

Fixes #7200.

In v4.2.0 (#7171) we changed POST handling to be stricter if
`operationName`, `variables`, or `extensions` were provided with a
surprising data type. This was intended to pass more of the optional
recommendations of the GraphQL Over HTTP spec as tested by the
graphql-http audit suite. However, we were overzealous and also banned
providing these parameters as an explicit `null`, which is documented by
the spec as legitimate. (And some clients, such as FIXME, actually send
`variables: null` in practice.)

We added explicit tests for this to the `graphql-http` test suite
(graphql/graphql-http#28) and this commit allows
these `null`s again.

Fixes #7200.
@netlify
Copy link

netlify bot commented Nov 28, 2022

Deploy Preview for apollo-server-docs ready!

Name Link
🔨 Latest commit 8f36279
🔍 Latest deploy log https://app.netlify.com/sites/apollo-server-docs/deploys/6385008dcc25380008eae03a
😎 Deploy Preview https://deploy-preview-7203--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

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 8f36279:

Sandbox Source
Apollo Server Typescript Configuration
Apollo Server Configuration

@glasser glasser merged commit 2042ee7 into main Nov 28, 2022
@glasser glasser deleted the glasser/v4.2.0-regression-null-parameters branch November 28, 2022 18:44
@github-actions github-actions bot mentioned this pull request Nov 28, 2022
@glasser
Copy link
Member Author

glasser commented Nov 28, 2022

Oops that FIXME in the PR desc was supposed to be https://github.com/graphql-rust/graphql-client (used by Rover)

glasser pushed a commit that referenced this pull request Nov 28, 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.2.2

### Patch Changes

- [#7203](#7203)
[`2042ee761`](2042ee7)
Thanks [@glasser](https://github.com/glasser)! - Fix v4.2.0 (#7171)
regression where `"operationName": null`, `"variables": null`, and
`"extensions": null` in POST bodies were improperly rejected.

- Updated dependencies
\[[`2042ee761`](2042ee7)]:
    -   @apollo/server@4.2.2

## @apollo/server@4.2.2

### Patch Changes

- [#7203](#7203)
[`2042ee761`](2042ee7)
Thanks [@glasser](https://github.com/glasser)! - Fix v4.2.0 (#7171)
regression where `"operationName": null`, `"variables": null`, and
`"extensions": null` in POST bodies were improperly rejected.

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.

v4.2 regression: variables: null (etc) should be allowed
2 participants