torchbox / wagtail-grapple

A Wagtail app that makes building GraphQL endpoints a breeze!

Home Page:https://wagtail-grapple.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating a DjangoObjectType without either the `fields` or the `exclude` option is deprecated

stephencockerill opened this issue · comments

Upgrading to wagtail 5.1 and graphene 3.3 results in the following deprecation warnings for all models registered with wagtail-grapple:

/home/wagtail/.local/lib/python3.9/site-packages/graphene/utils/subclass_with_meta.py:46: DeprecationWarning: Creating a DjangoObjectType without either the fields or the exclude option is deprecated. Add an explicit fields = '__all__' option on DjangoObjectType StubBlogPost to use all fields

The issue appears to be coming from grapple.actions.build_node_type:

    class StubMeta:
        model = stub_model

Based on the warning, there should be a fields = '__all__' attribute included.

I think the issue is fixed on the graphene side rather than here.

graphql-python/graphene#1530