graphene
graphene copied to clipboard
Get rid of Deprecation Warnings
In my current project which depends on graphene (3.3) I encountered my logs unusable since they were heavily polluted with the following warning:
/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 CollectionObjectType to use all fields
While trying to fix it just by adding the fields="__all__" option I stumbled upon this other one:
/home/wagtail/.local/lib/python3.9/site-packages/graphene/utils/subclass_with_meta.py:46: DeprecationWarning: Defining `exclude_fields` is deprecated in favour of `exclude`.
I believe this PR would make those warnings disappear without breaking anything AFAIK, at least that is what I found while testing it.
Codecov Report
Attention: 1 lines in your changes are missing coverage. Please review.
Comparison is base (
5fb7b54) 96.01% compared to head (63ca079) 95.96%.
| Files | Patch % | Lines |
|---|---|---|
| graphene/utils/subclass_with_meta.py | 75.00% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #1530 +/- ##
==========================================
- Coverage 96.01% 95.96% -0.05%
==========================================
Files 51 51
Lines 1755 1759 +4
==========================================
+ Hits 1685 1688 +3
- Misses 70 71 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Would it be possible to get this merged?
Sorry for the late response. To me it looks like this is an issue that should be fixed in graphene_django, namely removing the use of a deprecated field in graphene. I'd prefer a solution that uses the newest standard in graphene instead of un-deprecating the deprecated option in the core library. Can you open a PR there?