|
1 | | -''' |
| 1 | +""" |
2 | 2 | GraphQL.js provides a reference implementation for the GraphQL specification |
3 | 3 | but is also a useful utility for operating on GraphQL files and building |
4 | 4 | sophisticated tools. |
|
20 | 20 |
|
21 | 21 | from graphql import parse |
22 | 22 | from graphql.language.base import parse |
23 | | -''' |
| 23 | +""" |
24 | 24 | from .pyutils.version import get_version |
25 | 25 |
|
26 | 26 | # The primary entry point into fulfilling a GraphQL request. |
27 | | -from .graphql import ( |
28 | | - graphql |
29 | | -) |
| 27 | +from .graphql import graphql |
30 | 28 |
|
31 | 29 | # Create and operate on GraphQL type definitions and schema. |
32 | 30 | from .type import ( # no import order |
33 | 31 | GraphQLSchema, |
34 | | - |
35 | 32 | # Definitions |
36 | 33 | GraphQLScalarType, |
37 | 34 | GraphQLObjectType, |
|
45 | 42 | GraphQLField, |
46 | 43 | GraphQLInputObjectField, |
47 | 44 | GraphQLArgument, |
48 | | - |
49 | 45 | # "Enum" of Type Kinds |
50 | 46 | TypeKind, |
51 | | - |
52 | 47 | # "Enum" of Directive locations |
53 | 48 | DirectiveLocation, |
54 | | - |
55 | 49 | # Scalars |
56 | 50 | GraphQLInt, |
57 | 51 | GraphQLFloat, |
58 | 52 | GraphQLString, |
59 | 53 | GraphQLBoolean, |
60 | 54 | GraphQLID, |
61 | | - |
62 | 55 | # Directive definition |
63 | 56 | GraphQLDirective, |
64 | | - |
65 | 57 | # Built-in directives defined by the Spec |
66 | 58 | specified_directives, |
67 | 59 | GraphQLSkipDirective, |
68 | 60 | GraphQLIncludeDirective, |
69 | 61 | GraphQLDeprecatedDirective, |
70 | | - |
71 | 62 | # Constant Deprecation Reason |
72 | 63 | DEFAULT_DEPRECATION_REASON, |
73 | | - |
74 | 64 | # GraphQL Types for introspection. |
75 | 65 | __Schema, |
76 | 66 | __Directive, |
|
80 | 70 | __InputValue, |
81 | 71 | __EnumValue, |
82 | 72 | __TypeKind, |
83 | | - |
84 | 73 | # Meta-field definitions. |
85 | 74 | SchemaMetaFieldDef, |
86 | 75 | TypeMetaFieldDef, |
87 | 76 | TypeNameMetaFieldDef, |
88 | | - |
89 | 77 | # Predicates |
90 | 78 | is_type, |
91 | 79 | is_input_type, |
92 | 80 | is_output_type, |
93 | 81 | is_leaf_type, |
94 | 82 | is_composite_type, |
95 | 83 | is_abstract_type, |
96 | | - |
97 | 84 | # Un-modifiers |
98 | 85 | get_nullable_type, |
99 | 86 | get_named_type, |
|
103 | 90 | from .language.base import ( # no import order |
104 | 91 | Source, |
105 | 92 | get_location, |
106 | | - |
107 | 93 | # Parse |
108 | 94 | parse, |
109 | 95 | parse_value, |
110 | | - |
111 | 96 | # Print |
112 | 97 | print_ast, |
113 | | - |
114 | 98 | # Visit |
115 | 99 | visit, |
116 | 100 | ParallelVisitor, |
|
124 | 108 | subscribe, |
125 | 109 | ResolveInfo, |
126 | 110 | MiddlewareManager, |
127 | | - middlewares |
| 111 | + middlewares, |
128 | 112 | ) |
129 | 113 |
|
130 | 114 | # Validate GraphQL queries. |
131 | | -from .validation import ( # no import order |
132 | | - validate, |
133 | | - specified_rules, |
134 | | -) |
| 115 | +from .validation import validate, specified_rules # no import order |
135 | 116 |
|
136 | 117 | # Create and format GraphQL errors. |
137 | | -from .error import ( |
138 | | - GraphQLError, |
139 | | - format_error, |
140 | | -) |
| 118 | +from .error import GraphQLError, format_error |
141 | 119 |
|
142 | 120 | # Utilities for operating on GraphQL type schema and parsed sources. |
143 | 121 | from .utils.base import ( |
144 | 122 | # The GraphQL query recommended for a full schema introspection. |
145 | 123 | introspection_query, |
146 | | - |
147 | 124 | # Gets the target Operation from a Document |
148 | 125 | get_operation_ast, |
149 | | - |
150 | 126 | # Build a GraphQLSchema from an introspection result. |
151 | 127 | build_client_schema, |
152 | | - |
153 | 128 | # Build a GraphQLSchema from a parsed GraphQL Schema language AST. |
154 | 129 | build_ast_schema, |
155 | | - |
156 | 130 | # Extends an existing GraphQLSchema from a parsed GraphQL Schema |
157 | 131 | # language AST. |
158 | 132 | extend_schema, |
159 | | - |
160 | 133 | # Print a GraphQLSchema to GraphQL Schema language. |
161 | 134 | print_schema, |
162 | | - |
163 | 135 | # Create a GraphQLType from a GraphQL language AST. |
164 | 136 | type_from_ast, |
165 | | - |
166 | 137 | # Create a JavaScript value from a GraphQL language AST. |
167 | 138 | value_from_ast, |
168 | | - |
169 | 139 | # Create a GraphQL language AST from a JavaScript value. |
170 | 140 | ast_from_value, |
171 | | - |
172 | 141 | # A helper to use within recursive-descent visitors which need to be aware of |
173 | 142 | # the GraphQL type system. |
174 | 143 | TypeInfo, |
175 | | - |
176 | 144 | # Determine if JavaScript values adhere to a GraphQL type. |
177 | 145 | is_valid_value, |
178 | | - |
179 | 146 | # Determine if AST values adhere to a GraphQL type. |
180 | 147 | is_valid_literal_value, |
181 | | - |
182 | 148 | # Concatenates multiple AST together. |
183 | 149 | concat_ast, |
184 | | - |
185 | 150 | # Comparators for types |
186 | 151 | is_equal_type, |
187 | 152 | is_type_sub_type_of, |
188 | 153 | do_types_overlap, |
189 | | - |
190 | 154 | # Asserts a string is a valid GraphQL name. |
191 | 155 | assert_valid_name, |
192 | | - |
193 | 156 | # Undefined const |
194 | 157 | Undefined, |
195 | 158 | ) |
|
205 | 168 | set_default_backend, |
206 | 169 | ) |
207 | 170 |
|
208 | | -VERSION = (2, 1, 0, 'rc', 2) |
| 171 | +VERSION = (2, 1, 0, "rc", 2) |
209 | 172 | __version__ = get_version(VERSION) |
210 | 173 |
|
211 | 174 |
|
212 | 175 | __all__ = ( |
213 | | - '__version__', |
214 | | - 'graphql', |
215 | | - 'GraphQLBoolean', |
216 | | - 'GraphQLEnumType', |
217 | | - 'GraphQLEnumValue', |
218 | | - 'GraphQLFloat', |
219 | | - 'GraphQLID', |
220 | | - 'GraphQLInputObjectType', |
221 | | - 'GraphQLInt', |
222 | | - 'GraphQLInterfaceType', |
223 | | - 'GraphQLList', |
224 | | - 'GraphQLNonNull', |
225 | | - 'GraphQLField', |
226 | | - 'GraphQLInputObjectField', |
227 | | - 'GraphQLArgument', |
228 | | - 'GraphQLObjectType', |
229 | | - 'GraphQLScalarType', |
230 | | - 'GraphQLSchema', |
231 | | - 'GraphQLString', |
232 | | - 'GraphQLUnionType', |
233 | | - 'GraphQLDirective', |
234 | | - 'specified_directives', |
235 | | - 'GraphQLSkipDirective', |
236 | | - 'GraphQLIncludeDirective', |
237 | | - 'GraphQLDeprecatedDirective', |
238 | | - 'DEFAULT_DEPRECATION_REASON', |
239 | | - 'TypeKind', |
240 | | - 'DirectiveLocation', |
241 | | - '__Schema', |
242 | | - '__Directive', |
243 | | - '__DirectiveLocation', |
244 | | - '__Type', |
245 | | - '__Field', |
246 | | - '__InputValue', |
247 | | - '__EnumValue', |
248 | | - '__TypeKind', |
249 | | - 'SchemaMetaFieldDef', |
250 | | - 'TypeMetaFieldDef', |
251 | | - 'TypeNameMetaFieldDef', |
252 | | - 'get_named_type', |
253 | | - 'get_nullable_type', |
254 | | - 'is_abstract_type', |
255 | | - 'is_composite_type', |
256 | | - 'is_input_type', |
257 | | - 'is_leaf_type', |
258 | | - 'is_output_type', |
259 | | - 'is_type', |
260 | | - 'BREAK', |
261 | | - 'ParallelVisitor', |
262 | | - 'Source', |
263 | | - 'TypeInfoVisitor', |
264 | | - 'get_location', |
265 | | - 'parse', |
266 | | - 'parse_value', |
267 | | - 'print_ast', |
268 | | - 'visit', |
269 | | - 'execute', |
270 | | - 'subscribe', |
271 | | - 'ResolveInfo', |
272 | | - 'MiddlewareManager', |
273 | | - 'middlewares', |
274 | | - 'specified_rules', |
275 | | - 'validate', |
276 | | - 'GraphQLError', |
277 | | - 'format_error', |
278 | | - 'TypeInfo', |
279 | | - 'assert_valid_name', |
280 | | - 'ast_from_value', |
281 | | - 'build_ast_schema', |
282 | | - 'build_client_schema', |
283 | | - 'concat_ast', |
284 | | - 'do_types_overlap', |
285 | | - 'extend_schema', |
286 | | - 'get_operation_ast', |
287 | | - 'introspection_query', |
288 | | - 'is_equal_type', |
289 | | - 'is_type_sub_type_of', |
290 | | - 'is_valid_literal_value', |
291 | | - 'is_valid_value', |
292 | | - 'print_schema', |
293 | | - 'type_from_ast', |
294 | | - 'value_from_ast', |
295 | | - 'get_version', |
296 | | - 'Undefined', |
297 | | - 'GraphQLBackend', |
298 | | - 'GraphQLDocument', |
299 | | - 'GraphQLCoreBackend', |
300 | | - 'GraphQLDeciderBackend', |
301 | | - 'GraphQLCachedBackend', |
302 | | - 'get_default_backend', |
303 | | - 'set_default_backend', |
| 176 | + "__version__", |
| 177 | + "graphql", |
| 178 | + "GraphQLBoolean", |
| 179 | + "GraphQLEnumType", |
| 180 | + "GraphQLEnumValue", |
| 181 | + "GraphQLFloat", |
| 182 | + "GraphQLID", |
| 183 | + "GraphQLInputObjectType", |
| 184 | + "GraphQLInt", |
| 185 | + "GraphQLInterfaceType", |
| 186 | + "GraphQLList", |
| 187 | + "GraphQLNonNull", |
| 188 | + "GraphQLField", |
| 189 | + "GraphQLInputObjectField", |
| 190 | + "GraphQLArgument", |
| 191 | + "GraphQLObjectType", |
| 192 | + "GraphQLScalarType", |
| 193 | + "GraphQLSchema", |
| 194 | + "GraphQLString", |
| 195 | + "GraphQLUnionType", |
| 196 | + "GraphQLDirective", |
| 197 | + "specified_directives", |
| 198 | + "GraphQLSkipDirective", |
| 199 | + "GraphQLIncludeDirective", |
| 200 | + "GraphQLDeprecatedDirective", |
| 201 | + "DEFAULT_DEPRECATION_REASON", |
| 202 | + "TypeKind", |
| 203 | + "DirectiveLocation", |
| 204 | + "__Schema", |
| 205 | + "__Directive", |
| 206 | + "__DirectiveLocation", |
| 207 | + "__Type", |
| 208 | + "__Field", |
| 209 | + "__InputValue", |
| 210 | + "__EnumValue", |
| 211 | + "__TypeKind", |
| 212 | + "SchemaMetaFieldDef", |
| 213 | + "TypeMetaFieldDef", |
| 214 | + "TypeNameMetaFieldDef", |
| 215 | + "get_named_type", |
| 216 | + "get_nullable_type", |
| 217 | + "is_abstract_type", |
| 218 | + "is_composite_type", |
| 219 | + "is_input_type", |
| 220 | + "is_leaf_type", |
| 221 | + "is_output_type", |
| 222 | + "is_type", |
| 223 | + "BREAK", |
| 224 | + "ParallelVisitor", |
| 225 | + "Source", |
| 226 | + "TypeInfoVisitor", |
| 227 | + "get_location", |
| 228 | + "parse", |
| 229 | + "parse_value", |
| 230 | + "print_ast", |
| 231 | + "visit", |
| 232 | + "execute", |
| 233 | + "subscribe", |
| 234 | + "ResolveInfo", |
| 235 | + "MiddlewareManager", |
| 236 | + "middlewares", |
| 237 | + "specified_rules", |
| 238 | + "validate", |
| 239 | + "GraphQLError", |
| 240 | + "format_error", |
| 241 | + "TypeInfo", |
| 242 | + "assert_valid_name", |
| 243 | + "ast_from_value", |
| 244 | + "build_ast_schema", |
| 245 | + "build_client_schema", |
| 246 | + "concat_ast", |
| 247 | + "do_types_overlap", |
| 248 | + "extend_schema", |
| 249 | + "get_operation_ast", |
| 250 | + "introspection_query", |
| 251 | + "is_equal_type", |
| 252 | + "is_type_sub_type_of", |
| 253 | + "is_valid_literal_value", |
| 254 | + "is_valid_value", |
| 255 | + "print_schema", |
| 256 | + "type_from_ast", |
| 257 | + "value_from_ast", |
| 258 | + "get_version", |
| 259 | + "Undefined", |
| 260 | + "GraphQLBackend", |
| 261 | + "GraphQLDocument", |
| 262 | + "GraphQLCoreBackend", |
| 263 | + "GraphQLDeciderBackend", |
| 264 | + "GraphQLCachedBackend", |
| 265 | + "get_default_backend", |
| 266 | + "set_default_backend", |
304 | 267 | ) |
0 commit comments