Skip to content

Allow to import transports directly from gql #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion gql/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
from .client import Client
from .gql import gql
from .transport.aiohttp import AIOHTTPTransport
from .transport.requests import RequestsHTTPTransport
from .transport.websockets import WebsocketsTransport

__all__ = ["gql", "Client"]
__all__ = [
"gql",
"AIOHTTPTransport",
"Client",
"RequestsHTTPTransport",
"WebsocketsTransport",
]
8 changes: 8 additions & 0 deletions tests/test_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,11 @@ def test_named_query(client):
with use_cassette("queries"):
result = client.execute(query, operation_name="Planet2")
assert result == expected


def test_import_transports_directly_from_gql():
from gql import AIOHTTPTransport, RequestsHTTPTransport, WebsocketsTransport

assert AIOHTTPTransport
assert RequestsHTTPTransport
assert WebsocketsTransport