Skip to content

Commit ae02a3a

Browse files
committed
Implement remaining type validation tests.
Closes #8
1 parent 6c2cbb9 commit ae02a3a

File tree

2 files changed

+761
-17
lines changed

2 files changed

+761
-17
lines changed

graphql/core/type/definition.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def __init__(self, name, description=None, serialize=None, parse_value=None, par
116116
'functions are also provided.'
117117
).format(self)
118118

119-
if parse_value or parse_literal:
119+
if parse_value is not None or parse_literal is not None:
120120
assert callable(parse_value) and callable(parse_literal), (
121121
'{} must provide both "parse_value" and "parse_literal" functions.'.format(self)
122122
)
@@ -268,7 +268,7 @@ def define_interfaces(type, interfaces):
268268

269269
for interface in interfaces:
270270
assert isinstance(interface, GraphQLInterfaceType), (
271-
'{} may only implement Interface types, it cannot implement: {}'.format(type, interface)
271+
'{} may only implement Interface types, it cannot implement: {}.'.format(type, interface)
272272
)
273273

274274
if not callable(interface.type_resolver):
@@ -413,7 +413,7 @@ def __init__(self, name, types=None, resolve_type=None, description=None):
413413
if not has_resolve_type_fn:
414414
assert callable(type.is_type_of), (
415415
'Union Type {} does not provide a "resolve_type" function '
416-
'and possible type Type {} does not provide a "is_type_of" '
416+
'and possible Type {} does not provide a "is_type_of" '
417417
'function. There is no way to resolve this possible type '
418418
'during execution.'
419419
).format(self, type)

0 commit comments

Comments
 (0)