Skip to content

Commit 0cc2539

Browse files
committed
Synchronize and fix styling of __init.py__ files
Replicates graphql/graphql-js@86f6e82
1 parent a3aa902 commit 0cc2539

File tree

8 files changed

+49
-28
lines changed

8 files changed

+49
-28
lines changed

graphql/__init__.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@
4646

4747
# Create and operate on GraphQL type definitions and schema.
4848
from .type import (
49-
GraphQLSchema,
5049
# Definitions
50+
GraphQLSchema,
51+
GraphQLDirective,
5152
GraphQLScalarType,
5253
GraphQLObjectType,
5354
GraphQLInterfaceType,
@@ -57,10 +58,7 @@
5758
GraphQLInputObjectType,
5859
GraphQLList,
5960
GraphQLNonNull,
60-
GraphQLDirective,
61-
# "Enum" of Type Kinds
62-
TypeKind,
63-
# Scalars
61+
# Standard GraphQL Scalars
6462
specified_scalar_types,
6563
GraphQLInt,
6664
GraphQLFloat,
@@ -72,14 +70,16 @@
7270
GraphQLIncludeDirective,
7371
GraphQLSkipDirective,
7472
GraphQLDeprecatedDirective,
73+
# "Enum" of Type Kinds
74+
TypeKind,
7575
# Constant Deprecation Reason
7676
DEFAULT_DEPRECATION_REASON,
77+
# GraphQL Types for introspection.
78+
introspection_types,
7779
# Meta-field definitions.
7880
SchemaMetaFieldDef,
7981
TypeMetaFieldDef,
8082
TypeNameMetaFieldDef,
81-
# GraphQL Types for introspection.
82-
introspection_types,
8383
# Predicates
8484
is_schema,
8585
is_directive,
@@ -167,6 +167,7 @@
167167
get_location,
168168
# Lex
169169
Lexer,
170+
TokenKind,
170171
# Parse
171172
parse,
172173
parse_value,
@@ -178,12 +179,11 @@
178179
ParallelVisitor,
179180
TypeInfoVisitor,
180181
Visitor,
181-
TokenKind,
182-
DirectiveLocation,
183182
BREAK,
184183
SKIP,
185184
REMOVE,
186185
IDLE,
186+
DirectiveLocation,
187187
# Predicates
188188
is_definition_node,
189189
is_executable_definition_node,
@@ -196,9 +196,11 @@
196196
is_type_extension_node,
197197
# Types
198198
SourceLocation,
199-
# AST nodes
200199
Location,
201200
Token,
201+
# AST nodes
202+
Node,
203+
# Each kind of AST node
202204
NameNode,
203205
DocumentNode,
204206
DefinitionNode,
@@ -254,7 +256,7 @@
254256
InputObjectTypeExtensionNode,
255257
)
256258

257-
# Execute GraphQL queries.
259+
# Execute GraphQL documents.
258260
from .execution import (
259261
execute,
260262
default_field_resolver,
@@ -341,10 +343,10 @@
341343
lexicographic_sort_schema,
342344
# Print a GraphQLSchema to GraphQL Schema language.
343345
print_schema,
344-
# Prints the built-in introspection schema in the Schema Language format.
345-
print_introspection_schema,
346346
# Print a GraphQLType to GraphQL Schema language.
347347
print_type,
348+
# Prints the built-in introspection schema in the Schema Language format.
349+
print_introspection_schema,
348350
# Create a GraphQLType from a GraphQL language AST.
349351
type_from_ast,
350352
# Create a Python value from a GraphQL language AST with a Type.
@@ -374,18 +376,19 @@
374376
# Determine if a string is a valid GraphQL name.
375377
is_valid_name_error,
376378
# Compare two GraphQLSchemas and detect breaking changes.
377-
find_breaking_changes,
378-
find_dangerous_changes,
379379
BreakingChange,
380380
BreakingChangeType,
381381
DangerousChange,
382382
DangerousChangeType,
383+
find_breaking_changes,
384+
find_dangerous_changes,
383385
)
384386

385387
__all__ = [
386388
"graphql",
387389
"graphql_sync",
388390
"GraphQLSchema",
391+
"GraphQLDirective",
389392
"GraphQLScalarType",
390393
"GraphQLObjectType",
391394
"GraphQLInterfaceType",
@@ -395,8 +398,6 @@
395398
"GraphQLInputObjectType",
396399
"GraphQLList",
397400
"GraphQLNonNull",
398-
"GraphQLDirective",
399-
"TypeKind",
400401
"specified_scalar_types",
401402
"GraphQLInt",
402403
"GraphQLFloat",
@@ -407,11 +408,12 @@
407408
"GraphQLIncludeDirective",
408409
"GraphQLSkipDirective",
409410
"GraphQLDeprecatedDirective",
411+
"TypeKind",
410412
"DEFAULT_DEPRECATION_REASON",
413+
"introspection_types",
411414
"SchemaMetaFieldDef",
412415
"TypeMetaFieldDef",
413416
"TypeNameMetaFieldDef",
414-
"introspection_types",
415417
"is_schema",
416418
"is_directive",
417419
"is_type",
@@ -489,6 +491,7 @@
489491
"Source",
490492
"get_location",
491493
"Lexer",
494+
"TokenKind",
492495
"parse",
493496
"parse_value",
494497
"parse_type",
@@ -497,12 +500,11 @@
497500
"ParallelVisitor",
498501
"TypeInfoVisitor",
499502
"Visitor",
500-
"TokenKind",
501-
"DirectiveLocation",
502503
"BREAK",
503504
"SKIP",
504505
"REMOVE",
505506
"IDLE",
507+
"DirectiveLocation",
506508
"is_definition_node",
507509
"is_executable_definition_node",
508510
"is_selection_node",
@@ -515,6 +517,7 @@
515517
"SourceLocation",
516518
"Location",
517519
"Token",
520+
"Node",
518521
"NameNode",
519522
"DocumentNode",
520523
"DefinitionNode",
@@ -625,8 +628,8 @@
625628
"extend_schema",
626629
"lexicographic_sort_schema",
627630
"print_schema",
628-
"print_introspection_schema",
629631
"print_type",
632+
"print_introspection_schema",
630633
"type_from_ast",
631634
"value_from_ast",
632635
"value_from_ast_untyped",

graphql/error/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
"""
66

77
from .graphql_error import GraphQLError
8+
89
from .syntax_error import GraphQLSyntaxError
10+
911
from .located_error import located_error
12+
1013
from .print_error import print_error
14+
1115
from .format_error import format_error
16+
1217
from .invalid import INVALID, InvalidType
1318

1419
__all__ = [

graphql/error/format_error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
__all__ = ["format_error"]
88

99

10-
def format_error(error: "GraphQLError") -> dict:
10+
def format_error(error: "GraphQLError") -> Dict[str, Any]:
1111
"""Format a GraphQL error
1212
1313
Given a GraphQLError, format it according to the rules described by the "Response

graphql/execution/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
ExecutionResult,
1414
Middleware,
1515
)
16+
1617
from .middleware import MiddlewareManager
18+
1719
from .values import get_directive_values
1820

1921
__all__ = [

graphql/language/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
GraphQL language.
55
"""
66

7+
from .source import Source
8+
79
from .location import get_location, SourceLocation
10+
811
from .lexer import Lexer, TokenKind, Token
12+
913
from .parser import parse, parse_type, parse_value
14+
1015
from .printer import print_ast
11-
from .source import Source
16+
1217
from .visitor import (
1318
visit,
1419
Visitor,
@@ -19,6 +24,7 @@
1924
REMOVE,
2025
IDLE,
2126
)
27+
2228
from .ast import (
2329
Location,
2430
Node,

graphql/type/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@
115115

116116
# Common built-in scalar instances.
117117
from .scalars import (
118+
# Predicate
118119
is_specified_scalar_type,
120+
# Standard GraphQL Scalars
119121
specified_scalar_types,
120122
GraphQLInt,
121123
GraphQLFloat,
@@ -125,17 +127,19 @@
125127
)
126128

127129
from .introspection import (
128-
# "Enum" of Type Kinds
129-
TypeKind,
130-
# GraphQL Types for introspection.
130+
# Predicate
131131
is_introspection_type,
132+
# GraphQL Types for introspection.
132133
introspection_types,
134+
# "Enum" of Type Kinds
135+
TypeKind,
133136
# Meta-field definitions.
134137
SchemaMetaFieldDef,
135138
TypeMetaFieldDef,
136139
TypeNameMetaFieldDef,
137140
)
138141

142+
# Validate GraphQL schema.
139143
from .validate import validate_schema, assert_valid_schema
140144

141145
__all__ = [
@@ -234,9 +238,9 @@
234238
"GraphQLString",
235239
"GraphQLBoolean",
236240
"GraphQLID",
237-
"TypeKind",
238241
"is_introspection_type",
239242
"introspection_types",
243+
"TypeKind",
240244
"SchemaMetaFieldDef",
241245
"TypeMetaFieldDef",
242246
"TypeNameMetaFieldDef",

graphql/utilities/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
the GraphQL language and type objects.
55
"""
66

7-
# The GraphQL query recommended for a full schema introspection.
7+
# Produce the GraphQL query recommended for a full schema introspection.
88
from .introspection_query import get_introspection_query
99

1010
# Get the target Operation from a Document.

graphql/validation/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from .rules import ValidationRule, ASTValidationRule, SDLValidationRule
1212

13+
# All validation rules in the GraphQL Specification.
1314
from .specified_rules import specified_rules
1415

1516
# Spec Section: "Executable Definitions"

0 commit comments

Comments
 (0)