Skip to content

Conversation

@jwaldrip
Copy link

@jwaldrip jwaldrip commented Sep 5, 2025

Summary

  • Fixed blocking behavior in query/mutation execution to allow concurrent operations per connection
  • Simplified async handling by using Task.async instead of complex Task.Supervisor approach
  • Added conditional support for OpentelemetryProcessPropagator.Task for proper distributed tracing

Problem

Previously, queries and mutations were blocking, allowing only one query in progress per connection. This was incorrect as each query should be able to be fired and asynchronously listen for its response, following a similar flow to subscriptions.

Solution

  • Simplified the handle_query_or_mutation function to use Task.async for non-blocking execution
  • Results are delivered asynchronously via PubSub broadcasts
  • Added automatic detection and use of OpentelemetryProcessPropagator.Task when available for proper tracing context propagation
  • Removed unnecessary QuerySupervisor module that added complexity without benefit

Test Results

All tests pass, including the specific non_blocking_query_test.exs that verifies:

  • Multiple queries can execute concurrently
  • Fast queries complete before slow queries
  • All concurrent queries complete correctly

This brings query/mutation handling in line with how subscriptions work and matches what frontend transport layers expect.

🤖 Generated with Claude Code

jwaldrip and others added 6 commits February 19, 2025 09:51
Simplified async query/mutation handling to properly support concurrent operations:
- Replaced complex Task.Supervisor approach with simple Task.async
- Added conditional support for OpentelemetryProcessPropagator.Task for proper tracing
- Removed unnecessary QuerySupervisor module
- Queries/mutations now execute asynchronously like subscriptions

This allows multiple queries to run concurrently per connection, with fast
queries completing before slow ones as expected by frontend transport layers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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.

1 participant