Skip to content

Commit

Permalink
Trim docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jkimbo committed Jun 27, 2020
1 parent d933e04 commit efe7799
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion graphene/experimental/decorators/mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from graphene.types.scalars import Scalar
from graphene.types.utils import get_underlying_type
from graphene.utils.str_converters import to_camel_case
from graphene.utils.trim_docstring import trim_docstring


class MutationInvalidArgumentsError(Exception):
Expand Down Expand Up @@ -35,7 +36,9 @@ def mutation(return_type, arguments=None, **kwargs):

def decorate(resolver_function):
name = kwargs.pop("name", None) or resolver_function.__name__
description = kwargs.pop("description", None) or resolver_function.__doc__
description = kwargs.pop("description", None) or trim_docstring(
resolver_function.__doc__
)

invalid_arguments = []
for argument_name, argument in arguments.items():
Expand Down

0 comments on commit efe7799

Please sign in to comment.