Skip to content

Commit

Permalink
Wire httpx transport in gql-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
mss committed Dec 11, 2024
1 parent b2f2a68 commit 963e0c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gql/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def get_parser(with_examples: bool = False) -> ArgumentParser:
choices=[
"auto",
"aiohttp",
"httpx",
"phoenix",
"websockets",
"aiohttp_websockets",
Expand Down Expand Up @@ -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

Check warning on line 335 in gql/cli.py

View check run for this annotation

Codecov / codecov/patch

gql/cli.py#L335

Added line #L335 was not covered by tests

return HTTPXAsyncTransport(url=args.server, **transport_args)

Check warning on line 337 in gql/cli.py

View check run for this annotation

Codecov / codecov/patch

gql/cli.py#L337

Added line #L337 was not covered by tests

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)

Expand Down

0 comments on commit 963e0c2

Please sign in to comment.