Skip to content

Commit 485b8b7

Browse files
committed
Move introspection_query to core.utils.
Just a port of: dittos/graphqllib#70
1 parent e9acaaa commit 485b8b7

File tree

2 files changed

+76
-73
lines changed

2 files changed

+76
-73
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
introspection_query = '''
2+
query IntrospectionQuery {
3+
__schema {
4+
queryType { name }
5+
mutationType { name }
6+
types {
7+
...FullType
8+
}
9+
directives {
10+
name
11+
description
12+
args {
13+
...InputValue
14+
}
15+
onOperation
16+
onFragment
17+
onField
18+
}
19+
}
20+
}
21+
fragment FullType on __Type {
22+
kind
23+
name
24+
description
25+
fields {
26+
name
27+
description
28+
args {
29+
...InputValue
30+
}
31+
type {
32+
...TypeRef
33+
}
34+
isDeprecated
35+
deprecationReason
36+
}
37+
inputFields {
38+
...InputValue
39+
}
40+
interfaces {
41+
...TypeRef
42+
}
43+
enumValues {
44+
name
45+
description
46+
isDeprecated
47+
deprecationReason
48+
}
49+
possibleTypes {
50+
...TypeRef
51+
}
52+
}
53+
fragment InputValue on __InputValue {
54+
name
55+
description
56+
type { ...TypeRef }
57+
defaultValue
58+
}
59+
fragment TypeRef on __Type {
60+
kind
61+
name
62+
ofType {
63+
kind
64+
name
65+
ofType {
66+
kind
67+
name
68+
ofType {
69+
kind
70+
name
71+
}
72+
}
73+
}
74+
}
75+
'''

tests/core_type/test_introspection.py

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
from graphql.core import graphql
33
from graphql.core.error import format_error
4-
from graphql.core.language.location import SourceLocation
54
from graphql.core.language.parser import parse
65
from graphql.core.execution import execute
76
from graphql.core.type import (
@@ -17,78 +16,7 @@
1716
GraphQLEnumValue,
1817
)
1918
from graphql.core.validation.rules import ProvidedNonNullArguments
20-
21-
introspection_query = '''
22-
query IntrospectionQuery {
23-
__schema {
24-
queryType { name }
25-
mutationType { name }
26-
types {
27-
...FullType
28-
}
29-
directives {
30-
name
31-
args {
32-
name
33-
type { ...TypeRef }
34-
defaultValue
35-
}
36-
onOperation
37-
onFragment
38-
onField
39-
}
40-
}
41-
}
42-
fragment FullType on __Type {
43-
kind
44-
name
45-
fields {
46-
name
47-
args {
48-
name
49-
type { ...TypeRef }
50-
defaultValue
51-
}
52-
type {
53-
...TypeRef
54-
}
55-
isDeprecated
56-
deprecationReason
57-
}
58-
inputFields {
59-
name
60-
type { ...TypeRef }
61-
defaultValue
62-
}
63-
interfaces {
64-
...TypeRef
65-
}
66-
enumValues {
67-
name
68-
isDeprecated
69-
deprecationReason
70-
}
71-
possibleTypes {
72-
...TypeRef
73-
}
74-
}
75-
fragment TypeRef on __Type {
76-
kind
77-
name
78-
ofType {
79-
kind
80-
name
81-
ofType {
82-
kind
83-
name
84-
ofType {
85-
kind
86-
name
87-
}
88-
}
89-
}
90-
}
91-
'''
19+
from graphql.core.utils.introspection_query import introspection_query
9220

9321

9422
def sort_lists(value):

0 commit comments

Comments
 (0)