Skip to content

Commit 0075422

Browse files
committed
build_ast_schema: pass empty schema as literal
Replicates graphql/graphql-js@fe4f8eb
1 parent fdb0950 commit 0075422

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/graphql/utilities/build_ast_schema.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ def build_ast_schema(
4949

5050
assert_valid_sdl(document_ast)
5151

52+
empty_schema_config = GraphQLSchema(
53+
description=None,
54+
types=[],
55+
directives=[],
56+
extensions=None,
57+
extension_ast_nodes=[],
58+
assume_valid=False,
59+
).to_kwargs()
5260
schema_kwargs = extend_schema_impl(empty_schema_config, document_ast, assume_valid)
5361

5462
if not schema_kwargs["ast_node"]:
@@ -78,9 +86,6 @@ def build_ast_schema(
7886
return GraphQLSchema(**schema_kwargs)
7987

8088

81-
empty_schema_config = GraphQLSchema(directives=[]).to_kwargs()
82-
83-
8489
def build_schema(
8590
source: Union[str, Source],
8691
assume_valid: bool = False,

0 commit comments

Comments
 (0)