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(asgi.md): update example with default arg #1161

Merged
merged 1 commit into from Aug 22, 2021

Conversation

ossareh
Copy link
Contributor

@ossareh ossareh commented Aug 21, 2021

This change ensures the example code works. The code prior to this results in the stack trace below because response is not given a default value.

Traceback (most recent call last):
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 171, in run_asgi
    result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 59, in __call__
    return await self.app(scope, receive, send)
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/strawberry/asgi/__init__.py", line 340, in __call__
    await self.handle_websocket(scope=scope, receive=receive, send=send)
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/strawberry/asgi/__init__.py", line 96, in handle_websocket
    await self.handle_ws_message(ws, message)
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/strawberry/asgi/__init__.py", line 116, in handle_ws_message
    await self.handle_start(ws, message)
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/strawberry/asgi/__init__.py", line 135, in handle_start
    context = await self.get_context(ws)
TypeError: get_context() missing 1 required positional argument: 'response'

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

This change ensures the example code works. The code prior to this results in the stack trace below because response is not given a default value.

```
Traceback (most recent call last):
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 171, in run_asgi
    result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 59, in __call__
    return await self.app(scope, receive, send)
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/strawberry/asgi/__init__.py", line 340, in __call__
    await self.handle_websocket(scope=scope, receive=receive, send=send)
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/strawberry/asgi/__init__.py", line 96, in handle_websocket
    await self.handle_ws_message(ws, message)
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/strawberry/asgi/__init__.py", line 116, in handle_ws_message
    await self.handle_start(ws, message)
  File "/Users/ossareh/local/dev/src/github.com/erisyon/vega_v3/.venv/lib/python3.9/site-packages/strawberry/asgi/__init__.py", line 135, in handle_start
    context = await self.get_context(ws)
TypeError: get_context() missing 1 required positional argument: 'response'

```
@codecov
Copy link

codecov bot commented Aug 21, 2021

Codecov Report

Merging #1161 (3d5de71) into main (3dacd2d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1161   +/-   ##
=======================================
  Coverage   97.65%   97.65%           
=======================================
  Files          84       84           
  Lines        3205     3205           
  Branches      459      459           
=======================================
  Hits         3130     3130           
  Misses         41       41           
  Partials       34       34           

Copy link
Member

@jkimbo jkimbo left a comment

Choose a reason for hiding this comment

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

👍

@jkimbo jkimbo merged commit 0f555a6 into strawberry-graphql:main Aug 22, 2021
@ossareh ossareh deleted the patch-1 branch September 9, 2021 20:07
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

2 participants