Skip to content

Commit 2b17fa2

Browse files
committed
Fixed undefined imports
1 parent 460632f commit 2b17fa2

File tree

9 files changed

+19
-12
lines changed

9 files changed

+19
-12
lines changed

graphql/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@
112112
# Un-modifiers
113113
get_nullable_type,
114114
get_named_type,
115-
116-
# Undefined const
117-
Undefined
118115
)
119116

120117
# Parse and operate on GraphQL language source files.
@@ -205,6 +202,9 @@
205202

206203
# Asserts a string is a valid GraphQL name.
207204
assert_valid_name,
205+
206+
# Undefined const
207+
Undefined,
208208
)
209209

210210
__all__ = (

graphql/execution/executor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from ..error import GraphQLError, GraphQLLocatedError
1010
from ..pyutils.default_ordered_dict import DefaultOrderedDict
1111
from ..pyutils.ordereddict import OrderedDict
12-
from ..type import (Undefined, GraphQLEnumType, GraphQLInterfaceType, GraphQLList,
12+
from ..utils.undefined import Undefined
13+
from ..type import (GraphQLEnumType, GraphQLInterfaceType, GraphQLList,
1314
GraphQLNonNull, GraphQLObjectType, GraphQLScalarType,
1415
GraphQLSchema, GraphQLUnionType)
1516
from .base import (ExecutionContext, ExecutionResult, ResolveInfo,

graphql/execution/experimental/fragment.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
from ...pyutils.cached_property import cached_property
66
from ...pyutils.default_ordered_dict import DefaultOrderedDict
7-
from ...type import (Undefined, GraphQLInterfaceType, GraphQLList, GraphQLNonNull,
7+
from ...utils.undefined import Undefined
8+
from ...type import (GraphQLInterfaceType, GraphQLList, GraphQLNonNull,
89
GraphQLObjectType, GraphQLUnionType)
910
from ..base import ResolveInfo, collect_fields, get_field_def
1011
from ..values import get_argument_values

graphql/execution/values.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
from ..error import GraphQLError
77
from ..language import ast
88
from ..language.printer import print_ast
9-
from ..type import (Undefined, GraphQLEnumType, GraphQLInputObjectType, GraphQLList,
9+
from ..type import (GraphQLEnumType, GraphQLInputObjectType, GraphQLList,
1010
GraphQLNonNull, GraphQLScalarType, is_input_type)
1111
from ..utils.is_valid_value import is_valid_value
1212
from ..utils.type_from_ast import type_from_ast
1313
from ..utils.value_from_ast import value_from_ast
14+
from ..utils.undefined import Undefined
1415

1516
__all__ = ['get_variable_values', 'get_argument_values']
1617

graphql/type/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
is_leaf_type,
2020
is_type,
2121
get_nullable_type,
22-
is_output_type,
23-
Undefined
22+
is_output_type
2423
)
2524
from .directives import (
2625
# "Enum" of Directive locations

graphql/type/definition.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from ..pyutils.cached_property import cached_property
66
from ..pyutils.ordereddict import OrderedDict
77
from ..utils.assert_valid_name import assert_valid_name
8-
from ..utils.undefined import Undefined
98

109

1110
def is_type(type):

graphql/utils/base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
# Asserts that a string is a valid GraphQL name
5454
from .assert_valid_name import assert_valid_name
5555

56+
# Undefined const
57+
from .undefined import Undefined
58+
59+
5660
__all__ = [
5761
'introspection_query',
5862
'get_operation_ast',
@@ -72,4 +76,5 @@
7276
'is_equal_type',
7377
'is_type_sub_type_of',
7478
'assert_valid_name',
79+
'Undefined',
7580
]

graphql/utils/schema_printer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ..language.printer import print_ast
2-
from ..type.definition import (Undefined, GraphQLEnumType, GraphQLInputObjectType,
2+
from ..type.definition import (GraphQLEnumType, GraphQLInputObjectType,
33
GraphQLInterfaceType, GraphQLObjectType,
44
GraphQLScalarType, GraphQLUnionType)
55
from ..type.directives import DEFAULT_DEPRECATION_REASON
@@ -153,7 +153,7 @@ def _print_args(field_or_directives):
153153

154154

155155
def _print_input_value(name, arg):
156-
if arg.default_value not in (Undefined, None):
156+
if arg.default_value is not None:
157157
default_value = ' = ' + print_ast(ast_from_value(arg.default_value, arg.type))
158158
else:
159159
default_value = ''

graphql/utils/value_from_ast.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from ..language import ast
2-
from ..type import (Undefined, GraphQLEnumType, GraphQLInputObjectType, GraphQLList,
2+
from ..type import (GraphQLEnumType, GraphQLInputObjectType, GraphQLList,
33
GraphQLNonNull, GraphQLScalarType)
4+
from .undefined import Undefined
45

56

67
def value_from_ast(value_ast, type, variables=None):

0 commit comments

Comments
 (0)