mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-14 05:36:45 +03:00
Merge pull request #587 from ekampf/feature/enum_docs_update
Improved docs for Enums
This commit is contained in:
commit
71d5b1d943
|
@ -54,6 +54,13 @@ the ``Enum.from_enum`` function.
|
||||||
|
|
||||||
graphene.Enum.from_enum(AlreadyExistingPyEnum)
|
graphene.Enum.from_enum(AlreadyExistingPyEnum)
|
||||||
|
|
||||||
|
``Enum.from_enum`` supports a ``description`` and ``deprecation_reason`` lambdas as input so
|
||||||
|
you can add description etc. to your enum without changing the original:
|
||||||
|
|
||||||
|
.. code:: python
|
||||||
|
|
||||||
|
graphene.Enum.from_enum(AlreadyExistingPyEnum, description=lambda value: return 'foo' if value == AlreadyExistingPyEnum.Foo else 'bar')
|
||||||
|
|
||||||
|
|
||||||
Notes
|
Notes
|
||||||
-----
|
-----
|
||||||
|
|
Loading…
Reference in New Issue
Block a user