mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-16 19:12:21 +03:00
fix 'fields' and 'exclude' options being deprecated
This commit is contained in:
parent
5fb7b54377
commit
ccc3f423f3
|
@ -40,7 +40,13 @@ class SubclassWithMeta(metaclass=SubclassWithMeta_Meta):
|
||||||
"Abstract types can only contain the abstract attribute. "
|
"Abstract types can only contain the abstract attribute. "
|
||||||
f"Received: abstract, {', '.join(options)}"
|
f"Received: abstract, {', '.join(options)}"
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
if options.get("exclude_fields", None):
|
||||||
|
options["exclude"] = options.pop("exclude_fields")
|
||||||
|
elif not (options.get("fields", None) or options.get("exclude", None)):
|
||||||
|
options["fields"] = "__all__"
|
||||||
|
|
||||||
super_class = super(cls, cls)
|
super_class = super(cls, cls)
|
||||||
if hasattr(super_class, "__init_subclass_with_meta__"):
|
if hasattr(super_class, "__init_subclass_with_meta__"):
|
||||||
super_class.__init_subclass_with_meta__(**options)
|
super_class.__init_subclass_with_meta__(**options)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user