Skip to content

Commit 968d605

Browse files
author
Sam Cooke
committed
Add invariant for unreachable condition
Related GraphQL-js commit: graphql/graphql-js@7a15a3f
1 parent a033eae commit 968d605

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

graphql/execution/executor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@ def complete_value(self, ctx, return_type, field_asts, info, result):
265265
if isinstance(return_type, (GraphQLInterfaceType, GraphQLUnionType)):
266266
return self.complete_abstract_value(ctx, return_type, field_asts, info, result)
267267

268-
# Not reachable
269-
return None
268+
assert False, u'Cannot complete value of unexpected type "{}"'.format(return_type)
270269

271270
def complete_list_value(self, ctx, return_type, field_asts, info, result):
272271
"""

0 commit comments

Comments
 (0)