Skip to content

Commit

Permalink
Merge 12d8ef8 into 60a9609
Browse files Browse the repository at this point in the history
  • Loading branch information
jkimbo committed Mar 15, 2020
2 parents 60a9609 + 12d8ef8 commit a2a5aea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions graphene/types/base.py
Expand Up @@ -40,6 +40,11 @@ def __init_subclass_with_meta__(
return
_meta.name = name or cls.__name__
_meta.description = description or trim_docstring(cls.__doc__)

# Set all extra arguments onto the meta class as well
for key, value in _kwargs.items():
setattr(_meta, key, value)

_meta.freeze()
cls._meta = _meta
super(BaseType, cls).__init_subclass_with_meta__()
9 changes: 9 additions & 0 deletions graphene/types/tests/test_objecttype.py
Expand Up @@ -275,3 +275,12 @@ def resolve_hello(self, info):

schema = Schema(query=Query)
assert schema is not None


def test_objecttype_meta_extra_fields():
class Query(ObjectType):
class Meta:
name = "MyQuery"
foo = "bar"

assert Query._meta.foo == "bar"

0 comments on commit a2a5aea

Please sign in to comment.