diff --git a/graphene_django/static/graphene_django/graphiql.js b/graphene_django/static/graphene_django/graphiql.js index a37bb83..d97c797 100644 --- a/graphene_django/static/graphene_django/graphiql.js +++ b/graphene_django/static/graphene_django/graphiql.js @@ -71,7 +71,7 @@ try { return JSON.parse(responseBody); } catch (error) { - if (cookies.csrftoken.length) { + if (cookies.csrftoken && cookies.csrftoken.length) { headers['X-CSRFToken'] = cookies.csrftoken.pop(); return getFetch(headers); }