Skip to content

Commit 16c7613

Browse files
committed
Fixed fragment container in Python 3
1 parent ce85533 commit 16c7613

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

graphql/execution/experimental/fragment.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
from ..values import get_argument_values
1212
from ...error import GraphQLError
1313
from .utils import imap, normal_map
14-
14+
try:
15+
from itertools import izip as zip
16+
except:
17+
pass
1518

1619
def get_base_type(type):
1720
if isinstance(type, (GraphQLList, GraphQLNonNull)):
@@ -109,7 +112,11 @@ def partial_resolvers(self):
109112

110113
@cached_property
111114
def fragment_container(self):
112-
fields = zip(*self.partial_resolvers)[0]
115+
try:
116+
fields = next(zip(*self.partial_resolvers))
117+
except StopIteration:
118+
fields = tuple()
119+
113120
class FragmentInstance(dict):
114121
# def __init__(self):
115122
# self.fields = fields

0 commit comments

Comments
 (0)