From 459d7df42b7804d3427218bf8dc1ffe6f6f5ac39 Mon Sep 17 00:00:00 2001 From: Ivan Belokobylskiy Date: Wed, 27 Sep 2017 18:46:32 +0300 Subject: [PATCH] Access to batch endpoint without parameters fixed ValueError: max() arg is an empty sequence exception fixed --- graphene_django/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphene_django/views.py b/graphene_django/views.py index d7b8795..b2b5f91 100644 --- a/graphene_django/views.py +++ b/graphene_django/views.py @@ -106,7 +106,7 @@ class GraphQLView(View): 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] + 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)