question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Graphene Django is incompatible with django-filters 2.0.0

See original GitHub issue

When using graphene-django along with django-filter 2.0.0 I get an error trying to use the graphql endpoint.

A brief example:

class Query(object):
    projects = DjangoFilterConnectionField(
        MyProjectNode, filterset_class=MyProjectFilterSet)

This is the error:

`GrapheneMyProjectFilterSet.filter_for_reverse_field` has been removed. `GrapheneMyProjectFilterSet.filter_for_field` now generates filters for reverse fields. See: https://django-filter.readthedocs.io/en/master/guide/migration.html

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
phaltcommented, Aug 1, 2018

This actually prevents a django 2.1 upgrade, as Django 2.1 requires django-filters to be bumped to 2.0:

  File "/Users/paul.hallet/Envs/pgm-models/lib/python3.6/site-packages/django_filters/__init__.py", line 7, in <module>
    from .filterset import FilterSet
  File "/Users/paul.hallet/Envs/pgm-models/lib/python3.6/site-packages/django_filters/filterset.py", line 15, in <module>
    from .filters import (
  File "/Users/paul.hallet/Envs/pgm-models/lib/python3.6/site-packages/django_filters/filters.py", line 9, in <module>
    from django.db.models.sql.constants import QUERY_TERMS
ImportError: cannot import name 'QUERY_TERMS'

This is with the following requirements:

Django==2.1.0
graphene-django==2.1.0
django-filter==1.1.0
1reaction
sanketsauravcommented, Sep 3, 2018

I’ve run into the same issue: I want to use graphene-django with filtering capabilities in django==2.1.1 (the latest as of today).

Could someone please let me know if this is an immediate concern in the pipeline? If not, I would be happy to take this up and pitch in!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Graphene Django is incompatible with django-filters 2.0.0
When using graphene-django along with django-filter 2.0.0 I get an error trying to use the graphql endpoint. A brief example:
Read more >
Django graphene, filtering by object - python - Stack Overflow
Try graphene.types.generic.GenericScalar() from graphene.types.generic import GenericScalar class Document(graphene.
Read more >
graphene-django-extras - PyPI
This package adds some extra functionalities to graphene-django to facilitate the graphql use without Relay: Allow pagination and filtering on Queries. Allow ...
Read more >
Simple index - piwheels
... sillysort random-proxy graphene-django-plus linkedin-search-groups-scraper orderedpy darcyai lxg numutils-lg plotting-tools fio-product-attribute-strict ...
Read more >
graphene Changelog - pyup.io
hashable Enum by bkad in https://github.com/graphql-python/graphene/pull/1461 ... Added automatic `django-filters` support via `DjangoFilterConnectionField` ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found