File tree 3 files changed +56862
-1
lines changed
3 files changed +56862
-1
lines changed Original file line number Diff line number Diff line change
1
+ from graphql import build_client_schema , GraphQLSchema
2
+
3
+ # noinspection PyUnresolvedReferences
4
+ from ..fixtures import big_schema_introspection_result # noqa: F401
5
+
6
+
7
+ def test_building_ast_from_introspection (
8
+ benchmark , big_schema_introspection_result # noqa: F811
9
+ ):
10
+ schema : GraphQLSchema = benchmark (
11
+ lambda : build_client_schema (
12
+ big_schema_introspection_result ["data" ], assume_valid = True
13
+ )
14
+ )
15
+ assert schema .query_type is not None
Original file line number Diff line number Diff line change 1
1
"""Fixtures for graphql tests"""
2
-
2
+ import json
3
3
from os .path import dirname , join
4
4
5
5
from pytest import fixture # type: ignore
@@ -12,6 +12,11 @@ def read_graphql(name):
12
12
return open (path , encoding = "utf-8" ).read ()
13
13
14
14
15
+ def read_json (name ):
16
+ path = join (dirname (__file__ ), name + ".json" )
17
+ return json .loads (open (path , encoding = "utf-8" ).read ())
18
+
19
+
15
20
@fixture (scope = "module" )
16
21
def kitchen_sink_query ():
17
22
return read_graphql ("kitchen_sink" )
@@ -25,3 +30,8 @@ def kitchen_sink_sdl():
25
30
@fixture (scope = "module" )
26
31
def big_schema_sdl ():
27
32
return read_graphql ("github_schema" )
33
+
34
+
35
+ @fixture (scope = "module" )
36
+ def big_schema_introspection_result ():
37
+ return read_json ("github_schema" )
You can’t perform that action at this time.
0 commit comments