Skip to content

Commit ab1e694

Browse files
committed
introspection-test: convert schemas to SDL
Replicates graphql/graphql-js@97de840 Also makes build_ast_schemas() faster and more compatible.
1 parent 72bf40e commit ab1e694

File tree

2 files changed

+120
-120
lines changed

2 files changed

+120
-120
lines changed

src/graphql/utilities/build_ast_schema.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Union
1+
from typing import Any, Dict, Union
22

33
from ..language import DocumentNode, Source, parse
44
from ..type import GraphQLSchema, specified_directives
@@ -39,15 +39,19 @@ def build_ast_schema(
3939

4040
assert_valid_sdl(document_ast)
4141

42-
empty_schema_config = GraphQLSchema(
42+
empty_schema_kwargs: Dict[str, Any] = dict(
43+
query=None,
44+
mutation=None,
45+
subscription=None,
4346
description=None,
4447
types=[],
4548
directives=[],
4649
extensions=None,
50+
ast_node=None,
4751
extension_ast_nodes=[],
4852
assume_valid=False,
49-
).to_kwargs()
50-
schema_kwargs = extend_schema_impl(empty_schema_config, document_ast, assume_valid)
53+
)
54+
schema_kwargs = extend_schema_impl(empty_schema_kwargs, document_ast, assume_valid)
5155

5256
if not schema_kwargs["ast_node"]:
5357
for type_ in schema_kwargs["types"]:

0 commit comments

Comments
 (0)