Skip to content

Commit

Permalink
build_ast_schema: pass empty schema as literal
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Jul 5, 2020
1 parent fdb0950 commit 0075422
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/graphql/utilities/build_ast_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ def build_ast_schema(

assert_valid_sdl(document_ast)

empty_schema_config = GraphQLSchema(
description=None,
types=[],
directives=[],
extensions=None,
extension_ast_nodes=[],
assume_valid=False,
).to_kwargs()
schema_kwargs = extend_schema_impl(empty_schema_config, document_ast, assume_valid)

if not schema_kwargs["ast_node"]:
Expand Down Expand Up @@ -78,9 +86,6 @@ def build_ast_schema(
return GraphQLSchema(**schema_kwargs)


empty_schema_config = GraphQLSchema(directives=[]).to_kwargs()


def build_schema(
source: Union[str, Source],
assume_valid: bool = False,
Expand Down

0 comments on commit 0075422

Please sign in to comment.