diff --git a/graphene_django/views.py b/graphene_django/views.py index 4bf7349..cc9e8bb 100644 --- a/graphene_django/views.py +++ b/graphene_django/views.py @@ -108,12 +108,9 @@ class GraphQLView(View): request, data) if self.batch: - responses = [self.get_response( - request, entry) for entry in data] - result = '[{}]'.format( - ','.join([response[0] for response in responses])) - status_code = max( - responses, key=lambda response: response[1])[1] + responses = [self.get_response(request, entry) for entry in data] + result = '[{}]'.format(','.join([response[0] for response in responses])) + status_code = responses and max(responses, key=lambda response: response[1])[1] or 200 else: result, status_code = self.get_response( request, data, show_graphiql)