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 aiohttp query operation selection #2055

Conversation

DoctorJohn
Copy link
Member

Description

This PR fixed a regression introduced in #1686. Since said PR was released with version 0.107.0, the aiohttp integration ignored the operationName sent by clients. I fixed that and added a test for it :)

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Documentation

Issues Fixed or Closed by This PR

  • None

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@codecov
Copy link

codecov bot commented Jul 31, 2022

Codecov Report

Merging #2055 (d78d340) into main (5bf6e19) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2055   +/-   ##
=======================================
  Coverage   98.05%   98.05%           
=======================================
  Files         147      147           
  Lines        5874     5874           
  Branches     1107     1107           
=======================================
  Hits         5760     5760           
  Misses         58       58           
  Partials       56       56           

@botberry
Copy link
Member

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:


This release fixes that the AIOHTTP integration ignored the operationName of query
operations. This behaviour is a regression introduced in version 0.107.0.


Here's the preview release card for twitter:

Here's the tweet text:

🆕 Release (next) is out! Thanks to @NucleonJohn for the PR 👏

Get it here 👉 https://github.com/strawberry-graphql/strawberry/releases/tag/(next)

Copy link
Member

@patrick91 patrick91 left a comment

Choose a reason for hiding this comment

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

Thank you so much!

@patrick91 patrick91 merged commit aff2067 into strawberry-graphql:main Jul 31, 2022
nrbnlulu added a commit to nrbnlulu/strawberry that referenced this pull request Aug 1, 2022
* Bump ddtrace from 1.2.3 to 1.3.0 (strawberry-graphql#2050)

Bumps [ddtrace](https://github.com/DataDog/dd-trace-py) from 1.2.3 to 1.3.0.
- [Release notes](https://github.com/DataDog/dd-trace-py/releases)
- [Changelog](https://github.com/DataDog/dd-trace-py/blob/1.x/CHANGELOG.md)
- [Commits](DataDog/dd-trace-py@v1.2.3...v1.3.0)

---
updated-dependencies:
- dependency-name: ddtrace
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump types-setuptools from 63.2.1 to 63.2.2 (strawberry-graphql#2049)

Bumps [types-setuptools](https://github.com/python/typeshed) from 63.2.1 to 63.2.2.
- [Release notes](https://github.com/python/typeshed/releases)
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-setuptools
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add support for printing dictionaries when using custom scalars (strawberry-graphql#2048)

* Add support for printing dictionaries when using custom scalars

* Add support for nested dicts

* Add support for arguments

* Add test for bool and float

* Add test for id

* Test for list with values

* Add comment back

* Fix variable

* More tests

* More tests for lists

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add support for objects as default values

* Test more cases

* Ignore code paths

* Add one more test for floats

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Release 🍓 0.122.0

* Remove autoreload test (strawberry-graphql#2053)

* Fix aiohttp query operation selection (strawberry-graphql#2055)

* Release 🍓 0.122.1

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Patrick Arminio <patrick.arminio@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Botberry <bot@strawberry.rocks>
Co-authored-by: Jonathan Ehwald <github@ehwald.info>
bellini666 added a commit that referenced this pull request Aug 12, 2022
* Update dependencies

Add Channels optional dependency and an Extra package for channels

* Add documentation for Channels integration

* Add implementation for basic Channels integration

Complete implementation for websockets, partial implementation for HTTP (multipart/form-data still pending)

* Add unit tests for Channels integration

These unit tests are mostly copied over from FastAPI, and certainly aren't comprehensive or covering all the Channels-specific cases. However, they provide a reasonably good level of coverage for actual protocol behaviour.

The HTTP consumer does not yet have any unit tests.

* Add channels as dev dependency

* Fix code for python 3.7

* Update docs formatting

* Add release notes

* Fix typo

* Initial fixes for GET request

* Fix http handler

* fix: Handle disconnect should also reap completed tasks

* test: Fix channels websockets tests

* chore: Fix typing issues

* refactor: Pass the original error message along instead of a custom one

* fix: Fix urlpattern to handle `^graphql` instead of `^graph`

* feat: Finish HttpConsumer and also implement a sync version, with full testing coverage

* refactor: Inherit all handlers from the same base and better organize everything

* feat: Add channels layer typing protocol

* feat: Add a high level api for layers communication

* docs: Document how to use the high level layers event listener

* fix: Import Protocol from typing_extensions

* fix: Fix a typing issue with override

* fix: Fix the pyright test that just broke today

* test: Cover channels integration 100%

* fix: Pass response already encoded so that graphiql result doesn't get json encoded

* fix: Fix should_render_graphiql checking

* refactor: Handle invalid operation generically

* docs: Fix a small typo on documentation

* feat: Check for layers integration and give a better error message in case it is not found

* docs: Add a missing comma in documentation example

* check channels docs.

* check channels docs - fix .md references from camelCase to no case.

* check channels docs - added gql queries

* add tests docs

* add tests docs - added note about pytest.

* Fix .md code block annotation

Co-authored-by: Patrick Arminio <patrick.arminio@gmail.com>

* fixed grammar more clear explanation, formatting

* fix 404

* refactor: Only allow dotted access to channels context

* feat: Properly type channel_listen method

* channels docs - fit

* update fork (#1)

* Bump ddtrace from 1.2.3 to 1.3.0 (#2050)

Bumps [ddtrace](https://github.com/DataDog/dd-trace-py) from 1.2.3 to 1.3.0.
- [Release notes](https://github.com/DataDog/dd-trace-py/releases)
- [Changelog](https://github.com/DataDog/dd-trace-py/blob/1.x/CHANGELOG.md)
- [Commits](DataDog/dd-trace-py@v1.2.3...v1.3.0)

---
updated-dependencies:
- dependency-name: ddtrace
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump types-setuptools from 63.2.1 to 63.2.2 (#2049)

Bumps [types-setuptools](https://github.com/python/typeshed) from 63.2.1 to 63.2.2.
- [Release notes](https://github.com/python/typeshed/releases)
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-setuptools
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add support for printing dictionaries when using custom scalars (#2048)

* Add support for printing dictionaries when using custom scalars

* Add support for nested dicts

* Add support for arguments

* Add test for bool and float

* Add test for id

* Test for list with values

* Add comment back

* Fix variable

* More tests

* More tests for lists

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add support for objects as default values

* Test more cases

* Ignore code paths

* Add one more test for floats

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Release 🍓 0.122.0

* Remove autoreload test (#2053)

* Fix aiohttp query operation selection (#2055)

* Release 🍓 0.122.1

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Patrick Arminio <patrick.arminio@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Botberry <bot@strawberry.rocks>
Co-authored-by: Jonathan Ehwald <github@ehwald.info>

* Update docs/integrations/django.md

Co-authored-by: Jonathan Ehwald <github@ehwald.info>

* refactor: Remove not needed connection init timeout task cancellation

* refactor: s/import pathlib/from pathlib import Path/

* refactor: Default groups to an empty tuple

* chore: Add back channels dev dependency

* test: Fix tests that broke after last change to channel_listen

* docs: Add an explanation to why GraphqlWSHandler implements a handle_invalid_message method

* Update strawberry/channels/handlers/http_handler.py

Co-authored-by: Hans Huber <69171298+hans-brilliant@users.noreply.github.com>

* test: Fix tests that broke after last change

* Add log and missing marker

* Update release notes

* Minor docs update

* Add tweet file

* Docs update

Co-authored-by: Patrick Arminio <patrick.arminio@gmail.com>
Co-authored-by: Thiago Bellini Ribeiro <thiago@bellini.dev>
Co-authored-by: Nir <88795475+nrbnlulu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Botberry <bot@strawberry.rocks>
Co-authored-by: Jonathan Ehwald <github@ehwald.info>
Co-authored-by: Thiago Bellini Ribeiro <hackedbellini@gmail.com>
Co-authored-by: Hans Huber <69171298+hans-brilliant@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants