Skip to content

Commit aa77082

Browse files
committed
benchmark: test performance cost of re-creating schema
Replicates graphql/graphql-js@c7d7026
1 parent 71763a3 commit aa77082

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from graphql import GraphQLSchema, build_schema, print_schema
2+
3+
from ..fixtures import big_schema_sdl # noqa: F401
4+
5+
6+
def test_recreate_a_graphql_schema(benchmark, big_schema_sdl): # noqa: F811
7+
schema = build_schema(big_schema_sdl, assume_valid=True)
8+
recreated_schema: GraphQLSchema = benchmark(
9+
lambda: GraphQLSchema(**schema.to_kwargs())
10+
)
11+
assert print_schema(schema) == print_schema(recreated_schema)

0 commit comments

Comments
 (0)