Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include extra data in Meta in _meta #1328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adrianschneider94
Copy link

@adrianschneider94 adrianschneider94 commented Apr 21, 2021

I'm building an authorization middleware and I want to include functions/data in the Meta class to store the relevant information in the class itself.
However, all custom args in Meta are dropped at the moment.
I think there shouldn't be an issue to include other args in an extra attribute of _meta.

@adrianschneider94
Copy link
Author

Hey, could anyone have a look on this?
It's a very tiny change and does not break anything...

@adrianschneider94
Copy link
Author

Now the tests are broken... I have no idea, why...

@codecov
Copy link

codecov bot commented Aug 27, 2022

Codecov Report

Merging #1328 (bc73823) into master (355601b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1328   +/-   ##
=======================================
  Coverage   95.44%   95.45%           
=======================================
  Files          49       49           
  Lines        1582     1583    +1     
=======================================
+ Hits         1510     1511    +1     
  Misses         72       72           
Impacted Files Coverage Δ
graphene/types/base.py 96.96% <100.00%> (+0.09%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -43,6 +43,7 @@ def __init_subclass_with_meta__(
return
_meta.name = name or cls.__name__
_meta.description = description or trim_docstring(cls.__doc__)
_meta.extra = _kwargs
Copy link
Member

@erikwrede erikwrede Aug 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the extra field should be an explicit class attribute of the BaseOptions class so that it can be properly documented. Otherwise users will be confused about the meaning or the purpose/won't find it at all. LMK what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants