Skip to content
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

Using gql version of the get_introspection_query method #523

Merged
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
19 changes: 11 additions & 8 deletions gql/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
GraphQLSchema,
IntrospectionQuery,
build_ast_schema,
get_introspection_query,
parse,
validate,
)
Expand All @@ -39,7 +38,7 @@
from .transport.exceptions import TransportClosed, TransportQueryError
from .transport.local_schema import LocalSchemaTransport
from .transport.transport import Transport
from .utilities import build_client_schema
from .utilities import build_client_schema, get_introspection_query_ast
from .utilities import parse_result as parse_result_fn
from .utilities import serialize_variable_values
from .utils import str_first_element
Expand Down Expand Up @@ -87,8 +86,8 @@ def __init__(
:param transport: The provided :ref:`transport <Transports>`.
:param fetch_schema_from_transport: Boolean to indicate that if we want to fetch
the schema from the transport using an introspection query.
:param introspection_args: arguments passed to the get_introspection_query
method of graphql-core.
:param introspection_args: arguments passed to the
:meth:`gql.utilities.get_introspection_query_ast` method.
:param execute_timeout: The maximum time in seconds for the execution of a
request before a TimeoutError is raised. Only used for async transports.
Passing None results in waiting forever for a response.
Expand Down Expand Up @@ -1282,8 +1281,10 @@ def fetch_schema(self) -> None:

Don't use this function and instead set the fetch_schema_from_transport
attribute to True"""
introspection_query = get_introspection_query(**self.client.introspection_args)
execution_result = self.transport.execute(parse(introspection_query))
introspection_query = get_introspection_query_ast(
**self.client.introspection_args
)
execution_result = self.transport.execute(introspection_query)

self.client._build_schema_from_introspection(execution_result)

Expand Down Expand Up @@ -1650,8 +1651,10 @@ async def fetch_schema(self) -> None:

Don't use this function and instead set the fetch_schema_from_transport
attribute to True"""
introspection_query = get_introspection_query(**self.client.introspection_args)
execution_result = await self.transport.execute(parse(introspection_query))
introspection_query = get_introspection_query_ast(
**self.client.introspection_args
)
execution_result = await self.transport.execute(introspection_query)

self.client._build_schema_from_introspection(execution_result)

Expand Down
Loading