Skip to content

Commit 5209006

Browse files
committed
Port building Schema from AST benchmark
From src/utilities/__tests__/buildASTSchema-benchmark.js
1 parent a1f1201 commit 5209006

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from graphql import parse, build_ast_schema, GraphQLSchema
2+
3+
# noinspection PyUnresolvedReferences
4+
from ..fixtures import big_schema_sdl # noqa: F401
5+
6+
7+
def test_build_schema_from_ast(benchmark, big_schema_sdl): # noqa: F811
8+
schema_ast = parse(big_schema_sdl)
9+
schema: GraphQLSchema = benchmark(
10+
lambda: build_ast_schema(schema_ast, assume_valid=True)
11+
)
12+
assert schema.query_type is not None

0 commit comments

Comments
 (0)