From 63ca07916af53ccd1a58d51f638e84192b531ec5 Mon Sep 17 00:00:00 2001 From: PatillaCode Date: Tue, 21 Nov 2023 18:13:35 +0100 Subject: [PATCH] fix `fields` or the `exclude` option is deprecated pass fields param last try last try 2 re-try --- graphene/utils/subclass_with_meta.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/graphene/utils/subclass_with_meta.py b/graphene/utils/subclass_with_meta.py index c4ee11d7..ef2c7633 100644 --- a/graphene/utils/subclass_with_meta.py +++ b/graphene/utils/subclass_with_meta.py @@ -40,7 +40,13 @@ class SubclassWithMeta(metaclass=SubclassWithMeta_Meta): "Abstract types can only contain the abstract attribute. " f"Received: abstract, {', '.join(options)}" ) + 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) if hasattr(super_class, "__init_subclass_with_meta__"): super_class.__init_subclass_with_meta__(**options)