Repository: graphql-python/graphene-django

Issue:
Generated schema contains empty descriptions (v3)
While working on #976 I noticed that verious tests expect fields to have an empty description. In `/graphene_django/tests/test_types.py` for example, `\"""\"""` is expected within the generated schemas all over the place.

This is not the case on master. Furthermore the generated schema is not parsable by an GraphQL client I'm working with due to these empty descriptions.

I'll start working on an PR to fix this behaviour and related tests.


Discussion:

Resolving patch:
diff --git a/graphene_django/converter.py b/graphene_django/converter.py
--- a/graphene_django/converter.py
+++ b/graphene_django/converter.py
@@ -119,7 +119,7 @@ def convert_django_field_with_choices(
 
 
 def get_django_field_description(field):
-    return None if field.help_text is None else str(field.help_text)
+    return str(field.help_text) if field.help_text else None
 
 
 @singledispatch
@@ -230,11 +230,10 @@ def dynamic_type():
         if not _type:
             return
 
-        description = (
-            field.help_text
-            if isinstance(field, models.ManyToManyField)
-            else field.field.help_text
-        )
+        if isinstance(field, models.ManyToManyField):
+            description = get_django_field_description(field)
+        else:
+            description = get_django_field_description(field.field)
 
         # If there is a connection, we should transform the field
         # into a DjangoConnectionField
diff --git a/graphene_django/filter/utils.py b/graphene_django/filter/utils.py
--- a/graphene_django/filter/utils.py
+++ b/graphene_django/filter/utils.py
@@ -30,9 +30,7 @@ def get_filtering_args_from_filterset(filterset_class, type):
             form_field = filter_field.field
 
         field_type = convert_form_field(form_field).Argument()
-        field_type.description = (
-            None if filter_field.label is None else str(filter_field.label)
-        )
+        field_type.description = str(filter_field.label) if filter_field.label else None
         args[name] = field_type
 
     return args
diff --git a/graphene_django/forms/converter.py b/graphene_django/forms/converter.py
--- a/graphene_django/forms/converter.py
+++ b/graphene_django/forms/converter.py
@@ -9,7 +9,7 @@
 
 
 def get_form_field_description(field):
-    return None if field.help_text is None else str(field.help_text)
+    return str(field.help_text) if field.help_text else None
 
 
 @singledispatch


Test patch:
diff --git a/graphene_django/filter/tests/test_fields.py b/graphene_django/filter/tests/test_fields.py
--- a/graphene_django/filter/tests/test_fields.py
+++ b/graphene_django/filter/tests/test_fields.py
@@ -845,7 +845,6 @@ class Query(ObjectType):
         }
     
         type PetType implements Node {
-          \"""\"""
           age: Int!
     
           \"""The ID of the object\"""
@@ -915,7 +914,6 @@ class Query(ObjectType):
         }
 
         type PetType implements Node {
-          \"""\"""
           age: Int!
         
           \"""The ID of the object\"""
diff --git a/graphene_django/tests/test_types.py b/graphene_django/tests/test_types.py
--- a/graphene_django/tests/test_types.py
+++ b/graphene_django/tests/test_types.py
@@ -121,26 +121,14 @@ def test_schema_representation():
         type Article implements Node {
           \"""The ID of the object\"""
           id: ID!
-
-          \"""\"""
           headline: String!
-
-          \"""\"""
           pubDate: Date!
-
-          \"""\"""
           pubDateTime: DateTime!
-
-          \"""\"""
           reporter: Reporter!
-
-          \"""\"""
           editor: Reporter!
 
           \"""Language\"""
           lang: ArticleLang!
-
-          \"""\"""
           importance: ArticleImportance
         }
 
@@ -184,28 +172,13 @@ def test_schema_representation():
 
         \"""Reporter description\"""
         type Reporter {
-          \"""\"""
           id: ID!
-
-          \"""\"""
           firstName: String!
-
-          \"""\"""
           lastName: String!
-
-          \"""\"""
           email: String!
-
-          \"""\"""
           pets: [Reporter!]!
-
-          \"""\"""
           aChoice: ReporterAChoice
-
-          \"""\"""
           reporterType: ReporterReporterType
-
-          \"""\"""
           articles(before: String = null, after: String = null, first: Int = null, last: Int = null): ArticleConnection!
         }
 
@@ -513,13 +486,8 @@ class Query(ObjectType):
             }
 
             type Pet {
-              \"""\"""
               id: ID!
-
-              \"""\"""
               kind: String!
-
-              \"""\"""
               cuteness: Int!
             }
             """
@@ -543,13 +511,8 @@ class Query(ObjectType):
             }
 
             type Pet {
-              \"""\"""
               id: ID!
-
-              \"""\"""
               kind: PetModelKind!
-
-              \"""\"""
               cuteness: Int!
             }
 
@@ -582,13 +545,8 @@ class Query(ObjectType):
             }
 
             type Pet {
-              \"""\"""
               id: ID!
-
-              \"""\"""
               kind: String!
-
-              \"""\"""
               cuteness: Int!
             }
             """
@@ -616,10 +574,7 @@ class Query(ObjectType):
             }
 
             type PetModelKind {
-              \"""\"""
               id: ID!
-
-              \"""\"""
               kind: TestsPetModelKindChoices!
             }
 
@@ -658,10 +613,7 @@ class Query(ObjectType):
             }
 
             type PetModelKind {
-              \"""\"""
               id: ID!
-
-              \"""\"""
               kind: CustomEnumKind!
             }