Debian Codegraph @

tests/benchmarks/test_build_ast_schema.py

raw
1 from graphql import parse, build_ast_schema, GraphQLSchema
2
3 from ..fixtures import big_schema_sdl # noqa: F401
4
5
6 def test_build_schema_from_ast(benchmark, big_schema_sdl): # noqa: F811
7 schema_ast = parse(big_schema_sdl)
8 schema: GraphQLSchema = benchmark(
9 lambda: build_ast_schema(schema_ast, assume_valid=True)
10 )
11 assert schema.query_type is not None