Long story short, in my opinion,
This, (my class used for example)
...
@strawberry.type(description="Represents data about a device that is currently connected to the application")
class ActiveHdd(HddEntry):
serial: ID
...
Should be equivalent to this,
...
@strawberry.type
class ActiveHdd(HddEntry):
"""
Represents data about a device that is currently connected to the application
"""
serial: ID
...
We can gather this from the __doc__
attribute on the class, or a clean sanitized string using getdoc
from the inspect
module,
from inspect import getdoc
class MyClass:
"""
My class that should have a document string.
"""
pass
assert getdoc(MyClass) == 'My class that should have a document string.'
I believe the description should be gathered from the docstring if no description parameter is explicitly set.
What do you think? I love the project so far! I hope to contribute more at some point.
Thanks!
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too