Closed brett-fitz closed 3 weeks ago
I've also tried this example with the same error:
https://gql.readthedocs.io/en/stable/advanced/async_permanent_session.html#console-example
TransportAlreadyConnected: Transport is already connected
You have to run execute
on the session
created from client.connect_async
, not from client
directly.
extract from the docs:
# Create a session from the client which will reconnect automatically.
# This session can be kept in a class for example to provide a way
# to execute GraphQL queries from many different places
session = await client.connect_async(reconnecting=True)
# You can run execute or subscribe method on this session
result = await session.execute(query)
Describe the bug
This could be a common problem/user error but I've gone through the documentation of creating a async permanent session and the documented pattern does not seem to work.
Code
Error
_Note: If I switch to using
execute_async
method I get the following error:_I first tried this in an Jupyter environment but then tried it in an interpreter session and still got the same error.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
System info (please complete the following information):