Skip to content

Not able to use camelCase in orderBy field #1491

Open
@innateessence

Description

@innateessence

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).

telegram-cloud-photo-size-1-4974392837344963747-y

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions