Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Subscriptions: SSE distinct connection support #1195

Merged
merged 27 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ab5acdb
subscription over distinct SSE connection implementation and tests
danplischke Aug 26, 2024
e0410be
add changelog entry
danplischke Aug 26, 2024
870db53
fix linting
danplischke Aug 26, 2024
dba5700
fix mypy errors
danplischke Aug 26, 2024
d6d9f9f
fix pylint error, only visible in ci pipeline
danplischke Aug 26, 2024
cd3680a
fix content-length header being set
danplischke Aug 29, 2024
7ebd431
align ping message with graphql-sse implementation (https://github.co…
danplischke Aug 29, 2024
08b3db0
move sse to separate handler, add tests for configuration options, cl…
danplischke Dec 12, 2024
fc49301
remove pipe symbol for compatibility with older python versions
danplischke Dec 12, 2024
eeea4f1
Merge branch 'mirumee:main' into main
danplischke Dec 12, 2024
0243e1e
format and linting, update requirements.txt in fastapi integration te…
danplischke Dec 12, 2024
1a1b404
subscription over distinct SSE connection implementation and tests
danplischke Aug 26, 2024
7f39e37
Fix changelog entry conflicts
danplischke Aug 26, 2024
224586e
fix linting
danplischke Aug 26, 2024
56cceab
fix mypy errors
danplischke Aug 26, 2024
47c3cf3
fix pylint error, only visible in ci pipeline
danplischke Aug 26, 2024
a6a7985
fix content-length header being set
danplischke Aug 29, 2024
3ec7f6c
align ping message with graphql-sse implementation (https://github.co…
danplischke Aug 29, 2024
c7724f7
move sse to separate handler, add tests for configuration options, cl…
danplischke Dec 12, 2024
f2ada34
remove pipe symbol for compatibility with older python versions
danplischke Dec 12, 2024
5a18fc3
format and linting, update requirements.txt in fastapi integration te…
danplischke Dec 12, 2024
aca20a8
Merge remote-tracking branch 'origin/main'
danplischke Dec 18, 2024
08b71b3
Merge branch 'mirumee:main' into main
danplischke Dec 18, 2024
613be78
Merge branch 'mirumee:main' into main
danplischke Dec 20, 2024
753cb35
remove changelog entry as 0.24 has already been published
danplischke Dec 20, 2024
8f9e338
update changelog
rafalp Jan 29, 2025
ad491e4
Markdown formatting
rafalp Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ariadne/asgi/handlers/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ async def handle(self, scope: Scope, receive: Receive, send: Send) -> None:
response = await self.handle_request(request)
await response(scope, receive, send)

async def handle_request_override(self, _: Request) -> Optional[Response]:
"""Override the default request handling logic in subclasses.
Is called in the `handle_request` method before the default logic.
If None is returned, the default logic is executed.

# Required arguments:
`_`: the `Request` instance from Starlette or FastAPI.
"""
return None

async def handle_request(self, request: Request) -> Response:
"""Handle GraphQL request and return response for the client.

Expand All @@ -115,6 +125,10 @@ async def handle_request(self, request: Request) -> Response:

`request`: the `Request` instance from Starlette or FastAPI.
"""
response = await self.handle_request_override(request)
if response is not None:
return response

if request.method == "GET":
if self.execute_get_queries and request.query_params.get("query"):
return await self.graphql_http_server(request)
Expand Down
Loading
Loading