Skip to content

Commit ddfc429

Browse files
committed
build_client_schema: add missing tests for introspection validations
Replicates graphql/graphql-js@37c022d
1 parent 747fe14 commit ddfc429

File tree

3 files changed

+337
-155
lines changed

3 files changed

+337
-155
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ a query language for APIs created by Facebook.
1313
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
1414

1515
The current version 1.0.1 of GraphQL-core-next is up-to-date with GraphQL.js version
16-
14.0.2. All parts of the API are covered by an extensive test suite of currently 1692
16+
14.0.2. All parts of the API are covered by an extensive test suite of currently 1701
1717
unit tests.
1818

1919

graphql/utilities/build_client_schema.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,16 @@ def build_directive(directive_introspection: Dict) -> GraphQLDirective:
321321
# Get the root Query, Mutation, and Subscription types.
322322

323323
query_type_ref = schema_introspection.get("queryType")
324-
query_type = get_object_type(query_type_ref) if query_type_ref else None
324+
query_type = None if query_type_ref is None else get_object_type(query_type_ref)
325325
mutation_type_ref = schema_introspection.get("mutationType")
326-
mutation_type = get_object_type(mutation_type_ref) if mutation_type_ref else None
326+
mutation_type = (
327+
None if mutation_type_ref is None else get_object_type(mutation_type_ref)
328+
)
327329
subscription_type_ref = schema_introspection.get("subscriptionType")
328330
subscription_type = (
329-
get_object_type(subscription_type_ref) if subscription_type_ref else None
331+
None
332+
if subscription_type_ref is None
333+
else get_object_type(subscription_type_ref)
330334
)
331335

332336
# Get the directives supported by Introspection, assuming empty-set if directives

0 commit comments

Comments
 (0)