Open innateessence opened 8 months ago
Looks like this is indeed expected behavior, based on previously merged PRs addressing this in the past https://github.com/graphql-python/graphene-django/pull/1054
From a quick look there doesn't seem to be a quick fix for this. One workaround is if you have access to and can change model class you can do
fuel_type = JSONField(..., db_column="fuelType")
From a quick look there doesn't seem to be a quick fix for this. One workaround is if you have access to and can change model class you can do
fuel_type = JSONField(..., db_column="fuelType")
In my case, I believe this won't work as the key fuelType
is dynamically provided from a key from a JSONB field, which is pushed from an external codebase in charge of the data.
Any ideas in regards to bypassing the resolve_queryset
function from executing?
I don't mind explicitly writing my own order_by
functionality in Django's ORM outside of graphene-land.
Alternatively, it'd be nice if we could provide an optional override somehow to prevent this kind of behavior for codebases that have data that expect to perfor an order_by using a value in camelCase, possibly as a kwarg somewhere?
Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.
I execute a query with these arguments:
and
fuelType
(which isfuelType
as a JSON column in a Django DB) gets converted tofuel_type
before it reaches django's ORM.The culprit is here:
/usr/local/lib/python3.11/site-packages/graphene_django/filter/fields.py (line: 99) resolve_queryset()
On the version of graphene_django that I'm currently using (3.2.0).execute a query where
orderBy
has a value that is incamelCase
What is the expected behavior? I'd expect the naming convention not to cause such weird sorting behavior. (Or, at the least, give me an error telling me what is wrong and why I cannot use
camelCase
)What is the motivation / use case for changing the behavior? Please either add errors or fix the bug
Please tell us about your environment:
graphene-django = "==3.2.0"