Skip to content

Commit 9dcaee2

Browse files
committed
Fixed import order, __all__
1 parent de5cf4f commit 9dcaee2

File tree

5 files changed

+124
-26
lines changed

5 files changed

+124
-26
lines changed

graphql/__init__.py

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@
9797
)
9898

9999
# Create and format GraphQL errors.
100-
from .error import ( # no import order
100+
from .error import (
101101
GraphQLError,
102102
format_error,
103103
)
104104

105105

106106
# Utilities for operating on GraphQL type schema and parsed sources.
107-
from .utils.base import ( # no import order
107+
from .utils.base import (
108108
# The GraphQL query recommended for a full schema introspection.
109109
introspection_query,
110110

@@ -154,3 +154,60 @@
154154
# Asserts a string is a valid GraphQL name.
155155
assert_valid_name,
156156
)
157+
158+
__all__ = (
159+
'graphql',
160+
'GraphQLBoolean',
161+
'GraphQLEnumType',
162+
'GraphQLFloat',
163+
'GraphQLID',
164+
'GraphQLInputObjectType',
165+
'GraphQLInt',
166+
'GraphQLInterfaceType',
167+
'GraphQLList',
168+
'GraphQLNonNull',
169+
'GraphQLObjectType',
170+
'GraphQLScalarType',
171+
'GraphQLSchema',
172+
'GraphQLString',
173+
'GraphQLUnionType',
174+
'get_named_type',
175+
'get_nullable_type',
176+
'is_abstract_type',
177+
'is_composite_type',
178+
'is_input_type',
179+
'is_leaf_type',
180+
'is_output_type',
181+
'is_type',
182+
'BREAK',
183+
'ParallelVisitor',
184+
'Source',
185+
'TypeInfoVisitor',
186+
'get_location',
187+
'parse',
188+
'parse_value',
189+
'print_ast',
190+
'visit',
191+
'execute',
192+
'specified_rules',
193+
'validate',
194+
'GraphQLError',
195+
'format_error',
196+
'TypeInfo',
197+
'assert_valid_name',
198+
'ast_from_value',
199+
'build_ast_schema',
200+
'build_client_schema',
201+
'concat_ast',
202+
'do_types_overlap',
203+
'extend_schema',
204+
'get_operation_ast',
205+
'introspection_query',
206+
'is_equal_type',
207+
'is_type_sub_type_of',
208+
'is_valid_literal_value',
209+
'is_valid_value',
210+
'print_schema',
211+
'type_from_ast',
212+
'value_from_ast',
213+
)

graphql/language/base.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
from .location import ( get_location )
2-
from .lexer import ( Lexer )
3-
from .parser import ( parse, parse_value )
4-
from .printer import ( print_ast )
5-
from .source import ( Source )
6-
from .visitor import ( visit, ParallelVisitor, TypeInfoVisitor, BREAK )
1+
from .lexer import Lexer
2+
from .location import get_location
3+
from .parser import parse, parse_value
4+
from .printer import print_ast
5+
from .source import Source
6+
from .visitor import BREAK, ParallelVisitor, TypeInfoVisitor, visit
7+
8+
__all__ = [
9+
'Lexer',
10+
'get_location',
11+
'parse',
12+
'parse_value',
13+
'print_ast',
14+
'Source',
15+
'BREAK',
16+
'ParallelVisitor',
17+
'TypeInfoVisitor',
18+
'visit',
19+
]

graphql/utils/base.py

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,75 @@
1+
"""
2+
Base GraphQL utilities
3+
isort:skip_file
4+
"""
5+
16
# The GraphQL query recommended for a full schema introspection.
2-
from .introspection_query import ( introspection_query )
7+
from .introspection_query import introspection_query
38

49
# Gets the target Operation from a Document
5-
from .get_operation_ast import ( get_operation_ast )
10+
from .get_operation_ast import get_operation_ast
611

712
# Build a GraphQLSchema from an introspection result.
8-
from .build_client_schema import ( build_client_schema )
13+
from .build_client_schema import build_client_schema
914

1015
# Build a GraphQLSchema from a parsed GraphQL Schema language AST.
11-
from .build_ast_schema import ( build_ast_schema )
16+
from .build_ast_schema import build_ast_schema
1217

1318
# Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.
14-
from .extend_schema import ( extend_schema )
19+
from .extend_schema import extend_schema
1520

1621
# Print a GraphQLSchema to GraphQL Schema language.
17-
from .schema_printer import ( print_schema, print_introspection_schema )
22+
from .schema_printer import print_schema, print_introspection_schema
1823

1924
# Create a GraphQLType from a GraphQL language AST.
20-
from .type_from_ast import ( type_from_ast )
25+
from .type_from_ast import type_from_ast
2126

2227
# Create a JavaScript value from a GraphQL language AST.
23-
from .value_from_ast import ( value_from_ast )
28+
from .value_from_ast import value_from_ast
2429

2530
# Create a GraphQL language AST from a JavaScript value.
26-
from .ast_from_value import ( ast_from_value )
31+
from .ast_from_value import ast_from_value
2732

2833
# A helper to use within recursive-descent visitors which need to be aware of
2934
# the GraphQL type system.
30-
from .type_info import ( TypeInfo )
35+
from .type_info import TypeInfo
3136

3237
# Determine if JavaScript values adhere to a GraphQL type.
33-
from .is_valid_value import ( is_valid_value )
38+
from .is_valid_value import is_valid_value
3439

3540
# Determine if AST values adhere to a GraphQL type.
36-
from .is_valid_literal_value import ( is_valid_literal_value )
41+
from .is_valid_literal_value import is_valid_literal_value
3742

3843
# Concatenates multiple AST together.
39-
from .concat_ast import ( concat_ast )
44+
from .concat_ast import concat_ast
4045

4146
# Comparators for types
4247
from .type_comparators import (
43-
is_equal_type,
44-
is_type_sub_type_of,
45-
do_types_overlap
48+
is_equal_type,
49+
is_type_sub_type_of,
50+
do_types_overlap
4651
)
4752

4853
# Asserts that a string is a valid GraphQL name
49-
from .assert_valid_name import ( assert_valid_name )
54+
from .assert_valid_name import assert_valid_name
55+
56+
__all__ = [
57+
'introspection_query',
58+
'get_operation_ast',
59+
'build_client_schema',
60+
'build_ast_schema',
61+
'extend_schema',
62+
'print_introspection_schema',
63+
'print_schema',
64+
'type_from_ast',
65+
'value_from_ast',
66+
'ast_from_value',
67+
'TypeInfo',
68+
'is_valid_value',
69+
'is_valid_literal_value',
70+
'concat_ast',
71+
'do_types_overlap',
72+
'is_equal_type',
73+
'is_type_sub_type_of',
74+
'assert_valid_name',
75+
]

graphql/validation/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
from .validation import validate
22
from .rules import specified_rules
3+
4+
__all__ = ['validate', 'specified_rules']

graphql/validation/tests/test_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from graphql import parse, validate
22
from graphql.utils.type_info import TypeInfo
3-
from graphql.validation.validate import visit_using_rules
43
from graphql.validation.rules import specified_rules
4+
from graphql.validation.validate import visit_using_rules
55

66
from .utils import test_schema
77

0 commit comments

Comments
 (0)