File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ def get_parser(with_examples: bool = False) -> ArgumentParser:
157
157
choices = [
158
158
"auto" ,
159
159
"aiohttp" ,
160
+ "httpx" ,
160
161
"phoenix" ,
161
162
"websockets" ,
162
163
"aiohttp_websockets" ,
@@ -330,6 +331,11 @@ def get_transport(args: Namespace) -> Optional[AsyncTransport]:
330
331
331
332
return AIOHTTPTransport (url = args .server , ** transport_args )
332
333
334
+ elif transport_name == "httpx" :
335
+ from gql .transport .httpx import HTTPXAsyncTransport
336
+
337
+ return HTTPXAsyncTransport (url = args .server , ** transport_args )
338
+
333
339
elif transport_name == "phoenix" :
334
340
from gql .transport .phoenix_channel_websockets import (
335
341
PhoenixChannelWebsocketsTransport ,
Original file line number Diff line number Diff line change @@ -190,6 +190,22 @@ def test_cli_get_transport_aiohttp(parser, url):
190
190
assert isinstance (transport , AIOHTTPTransport )
191
191
192
192
193
+ @pytest .mark .httpx
194
+ @pytest .mark .parametrize (
195
+ "url" ,
196
+ ["http://your_server.com" , "https://your_server.com" ],
197
+ )
198
+ def test_cli_get_transport_httpx (parser , url ):
199
+
200
+ from gql .transport .httpx import HTTPXAsyncTransport
201
+
202
+ args = parser .parse_args ([url , "--transport" , "httpx" ])
203
+
204
+ transport = get_transport (args )
205
+
206
+ assert isinstance (transport , HTTPXAsyncTransport )
207
+
208
+
193
209
@pytest .mark .websockets
194
210
@pytest .mark .parametrize (
195
211
"url" ,
You can’t perform that action at this time.
0 commit comments