We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let's say I want to keep auto-camelcasing enabled for my whole service except for a couple of fields
e.g. maybe i have a translations service and want to write schema/query like this:
query { getTranslations(string: "Hello world") { en_US fr_FR } }
Ideally, I could write resolvers like this
@strawberry.type class Translations: @strawberry.field(disable_auto_camelcase=True) def en_US(self) -> str: ... @strawberry.field(disable_auto_camelcase=True) def fr_FR(self) -> str: ...
or maybe even for a whole type?
@strawberry.type(disable_auto_camelcase=True) class Translations: @strawberry.field def en_US(self) -> str: ... @strawberry.field def fr_FR(self) -> str: ...
Thanks!
[x] Alteration (enhancement/optimization) of existing feature(s)
The text was updated successfully, but these errors were encountered:
It looks like the name=... parameter takes priority over auto camel-casing, so this should work:
name=...
@strawberry.type class Translations: @strawberry.field(name="en_US") def en_US(self) -> str: ... @strawberry.field(name="fr_FR") def fr_FR(self) -> str: ...
I'm unsure if there's a unit test for this use-case.
Sorry, something went wrong.
I was going to suggest that, but I wonder if @magicmark would prefer to avoid the duplication?
This works for me. Thanks!
No branches or pull requests
Let's say I want to keep auto-camelcasing enabled for my whole service except for a couple of fields
e.g. maybe i have a translations service and want to write schema/query like this:
Ideally, I could write resolvers like this
or maybe even for a whole type?
Thanks!
Feature Request Type
[x] Alteration (enhancement/optimization) of existing feature(s)
Upvote & Fund
The text was updated successfully, but these errors were encountered: