Skip to content

Commit 963e0c2

Browse files
committed
Wire httpx transport in gql-cli
1 parent b2f2a68 commit 963e0c2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: gql/cli.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def get_parser(with_examples: bool = False) -> ArgumentParser:
157157
choices=[
158158
"auto",
159159
"aiohttp",
160+
"httpx",
160161
"phoenix",
161162
"websockets",
162163
"aiohttp_websockets",
@@ -330,10 +331,13 @@ def get_transport(args: Namespace) -> Optional[AsyncTransport]:
330331

331332
return AIOHTTPTransport(url=args.server, **transport_args)
332333

334+
elif transport_name == "httpx":
335+
from gql.transport.httpx import HTTPXAsyncTransport
336+
337+
return HTTPXAsyncTransport(url=args.server, **transport_args)
338+
333339
elif transport_name == "phoenix":
334-
from gql.transport.phoenix_channel_websockets import (
335-
PhoenixChannelWebsocketsTransport,
336-
)
340+
from gql.transport.phoenix_channel_websockets import PhoenixChannelWebsocketsTransport
337341

338342
return PhoenixChannelWebsocketsTransport(url=args.server, **transport_args)
339343

0 commit comments

Comments
 (0)