mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-27 16:29:48 +03:00
Propagate specific mutation description to the mutation schema
This commit is contained in:
parent
71d5b1d943
commit
1773c13d1d
|
@ -77,5 +77,6 @@ class Mutation(ObjectType):
|
||||||
@classmethod
|
@classmethod
|
||||||
def Field(cls, *args, **kwargs):
|
def Field(cls, *args, **kwargs):
|
||||||
return Field(
|
return Field(
|
||||||
cls._meta.output, args=cls._meta.arguments, resolver=cls._meta.resolver
|
cls._meta.output, args=cls._meta.arguments, resolver=cls._meta.resolver,
|
||||||
|
description=cls._meta.description
|
||||||
)
|
)
|
||||||
|
|
|
@ -36,6 +36,7 @@ def test_generate_mutation_with_meta():
|
||||||
assert MyMutation._meta.description == "Documentation"
|
assert MyMutation._meta.description == "Documentation"
|
||||||
resolved = MyMutation.Field().resolver(None, None, name='Peter')
|
resolved = MyMutation.Field().resolver(None, None, name='Peter')
|
||||||
assert resolved == {'name': 'Peter'}
|
assert resolved == {'name': 'Peter'}
|
||||||
|
assert MyMutation.Field().description == "Documentation"
|
||||||
|
|
||||||
|
|
||||||
def test_mutation_raises_exception_if_no_mutate():
|
def test_mutation_raises_exception_if_no_mutate():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user