torchbox / wagtail-grapple

A Wagtail app that makes building GraphQL endpoints a breeze!
https://wagtail-grapple.readthedocs.io/en/latest/
Other
152 stars 57 forks source link

request: setting to disable auto-conversion from snake_case to camelCase #40

Closed indirectlylit closed 4 years ago

indirectlylit commented 4 years ago

Currently, the graphene schema is initialized as follows:

https://github.com/torchbox/wagtail-grapple/blob/c35408ad3e6a5e273d1e2316c0f3c988f5064501/grapple/schema.py#L47-L49

This automatically converts model attribute names from e.g. url_path to urlPath. While some people might like this because it conforms to the convention of camel-casing names in javascript, it also fails the grep test which makes things harder for someone exploring a new codebase and learning a new stack.

Recommend adding a new setting, e.g. GRAPPLE_AUTO_CAMELCASE which can be set to False and passed to graphene through the auto_camelcase parameter.

indirectlylit commented 4 years ago

thank you!