-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn if fields
or exclude
are not defined on DjangoObjectType
#981
Conversation
9d7fb3b
to
d318119
Compare
* all examples have fields or exclude set * mention that if neither fields nor exclude is used, warning will be raised
@jkimbo let me know if the tests and docs changes are expected here or if I should just leave it throwing warnings and don't mention in docs until it is |
@radekwlsk thanks, this is great. Mentioning it in the docs is great too. Thinking about it though maybe we should raise |
@jkimbo sure, with major release it would be too bad. Especially if it is mentioned in the v2 to v3 migration notes. I will change it tomorrow then. |
* as it is a major release 3, start right away from DeprecationWarning for ObjectTypes missing fields or exclude option * updated docs information to be more forbidding
@jkimbo Warning level bumped to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @radekwlsk !
To make use of Django-Graphene more familiar to folks using DRF
PendingDeprecationWarning
DeprecationWarning
(edit: changed in 805480) is issued whenDjangoObjectType
has neitherfields
norexclude
option set.Current deprecations of
exclude_fields
andonly_fields
are taken into account as this check happens after they are copied over tofields
orexclude
.All tests, examples and docs are also updated so that they won't issue this warning. Documentation mentions that warning in docs/queries.rst#specifying-which-fields-to-include and instructs how to avoid it.
Change is part of v3 release discussed in #705.
Closes #710