graphql-python / graphql-python/graphene-django
Not able to use camelCase in `orderBy` field
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 760
- PR merge metrics
- No merged PRs in 30d
Description
**Note: for support questions, please use stackoverflow**. This repository's issues are reserved for feature requests and bug reports.
* **What is the current behavior?**
I execute a query with these arguments:
```
{
"first": 50,
"kind": "QXNzZXRLaW5kOjMzZGYxZmNhLWI0NTAtNDcyZS05ZmYzLWI5NzcxZmYxMzlkMZ==",
"after": null,
"search": null,
"orderBy": "fuelType"
}
```
and `fuelType` (which is `fuelType` as a JSON column in a Django DB)
gets converted to `fuel_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).

* **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem** via
a github repo, https://repl.it or similar (you can use this template as a starting point: https://repl.it/@jkimbo/Graphene-Django-Example).
execute a query where `orderBy` has a value that is in `camelCase`
* **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:**
- Version:
- Platform:
graphene-django = "==3.2.0"
* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
Contributor guide
Assessment
This issue has not been assessed yet.