From 963e0c24c5e7c7f0385480f87167a93443a8aa74 Mon Sep 17 00:00:00 2001 From: "Malte S. Stretz" Date: Wed, 11 Dec 2024 13:12:50 +0100 Subject: [PATCH] Wire httpx transport in gql-cli --- gql/cli.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gql/cli.py b/gql/cli.py index a7d129e2..7302f33a 100644 --- a/gql/cli.py +++ b/gql/cli.py @@ -157,6 +157,7 @@ def get_parser(with_examples: bool = False) -> ArgumentParser: choices=[ "auto", "aiohttp", + "httpx", "phoenix", "websockets", "aiohttp_websockets", @@ -330,10 +331,13 @@ def get_transport(args: Namespace) -> Optional[AsyncTransport]: return AIOHTTPTransport(url=args.server, **transport_args) + elif transport_name == "httpx": + from gql.transport.httpx import HTTPXAsyncTransport + + return HTTPXAsyncTransport(url=args.server, **transport_args) + elif transport_name == "phoenix": - from gql.transport.phoenix_channel_websockets import ( - PhoenixChannelWebsocketsTransport, - ) + from gql.transport.phoenix_channel_websockets import PhoenixChannelWebsocketsTransport return PhoenixChannelWebsocketsTransport(url=args.server, **transport_args)