Skip to content

Commit

Permalink
Explicitly include all fields in test schema to avoid deprecation war…
Browse files Browse the repository at this point in the history
…ning

Otherwise we encounter this warning:

```
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 User to use all fields
    super_class.__init_subclass_with_meta__(**options)
```
  • Loading branch information
sjdemartini committed Oct 19, 2022
1 parent 9d59f85 commit 746808e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@
class Project(DjangoObjectType):
class Meta:
model = models.Project
fields = "__all__"


class Expense(DjangoObjectType):
class Meta:
model = models.Expense
fields = "__all__"


class User(DjangoObjectType):
class Meta:
model = UserModel
fields = "__all__"


# Queries
Expand Down

0 comments on commit 746808e

Please sign in to comment.