Skip to content

Commit fe4a463

Browse files
committed
Bump PendingDeprecationWarning to DeprecationWarning
* as it is a major release 3, start right away from DeprecationWarning for ObjectTypes missing fields or exclude option * updated docs information to be less forbidding
1 parent 3d497ea commit fe4a463

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

docs/queries.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ all fields that should be exposed using the fields attribute.
5454
This will make it less likely to result in unintentionally exposing data when
5555
your models change.
5656

57-
Setting neither ``fields`` nor ``exclude`` is allowed but will raise a warning, to
58-
avoid that you can easily make ``DjangoObjectType`` include all fields in the model as
59-
described below.
57+
Setting neither ``fields`` nor ``exclude`` is deprecated and will raise a warning, you should at least explicitly make
58+
``DjangoObjectType`` include all fields in the model as described below.
6059

6160
``fields``
6261
~~~~~~~~~~

graphene_django/tests/test_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ class Meta:
482482
@with_local_registry
483483
def test_django_objecttype_neither_fields_nor_exclude():
484484
with pytest.warns(
485-
PendingDeprecationWarning,
485+
DeprecationWarning,
486486
match=r"Creating a DjangoObjectType without either the `fields` "
487487
"or the `exclude` option is deprecated.",
488488
):

graphene_django/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def __init_subclass_with_meta__(
226226
"or the `exclude` option is deprecated. Add an explicit `fields "
227227
"= '__all__'` option on DjangoObjectType {class_name} to use all "
228228
"fields".format(class_name=cls.__name__,),
229-
PendingDeprecationWarning,
229+
DeprecationWarning,
230230
stacklevel=2,
231231
)
232232

0 commit comments

Comments
 (0)