@@ -113,8 +113,8 @@ def execute(self, document: DocumentNode, *args, **kwargs) -> Dict:
113
113
loop = asyncio .get_event_loop ()
114
114
115
115
assert not loop .is_running (), (
116
- "Cannot run client.execute if an asyncio loop is running."
117
- " Use execute_async instead."
116
+ "Cannot run client.execute(query) if an asyncio loop is running."
117
+ " Use 'await client. execute_async(query)' instead."
118
118
)
119
119
120
120
data : Dict [Any , Any ] = loop .run_until_complete (
@@ -151,8 +151,8 @@ def subscribe(
151
151
loop = asyncio .get_event_loop ()
152
152
153
153
assert not loop .is_running (), (
154
- "Cannot run client.subscribe if an asyncio loop is running."
155
- " Use subscribe_async instead."
154
+ "Cannot run client.subscribe(query) if an asyncio loop is running."
155
+ " Use 'await client. subscribe_async(query)' instead."
156
156
)
157
157
158
158
try :
@@ -199,9 +199,10 @@ async def __aexit__(self, exc_type, exc, tb):
199
199
200
200
def __enter__ (self ):
201
201
202
- assert not isinstance (
203
- self .transport , AsyncTransport
204
- ), "Only a sync transport can be use. Use 'async with Client(...)' instead"
202
+ assert not isinstance (self .transport , AsyncTransport ), (
203
+ "Only a sync transport can be used."
204
+ " Use 'async with Client(...) as session:' instead"
205
+ )
205
206
206
207
self .transport .connect ()
207
208
0 commit comments