From 0eb3a3e6b0516dbfbddc6ceb74fd7cfea617f574 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Wed, 12 Oct 2022 13:09:03 +0200 Subject: [PATCH] Fixed assert name conversion --- graphene_django/converter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/graphene_django/converter.py b/graphene_django/converter.py index 09072ac..61ec84f 100644 --- a/graphene_django/converter.py +++ b/graphene_django/converter.py @@ -26,7 +26,12 @@ from graphene import ( from graphene.types.json import JSONString from graphene.types.scalars import BigInt from graphene.utils.str_converters import to_camel_case -from graphql import GraphQLError, assert_name +from graphql import GraphQLError +try: + from graphql import assert_name +except ImportError: + # Support for older versions of graphql + from graphql import assert_valid_name as assert_name from graphql.pyutils import register_description from .compat import ArrayField, HStoreField, JSONField, PGJSONField, RangeField