I'm writing some integration tests that use an HTTP client to hit our GQL API like so:
resp = await client.post(
"/api/",
headers={"Content-Type": "application/json"},
json={
"query": query,
"variables": {"form": strawberry.asdict(saml_configuration_form)},
},
)
In this example, saml_configuration_form
is a strawberry input type:
@strawberry.experimental.pydantic.input(model=SAMLConfigurationPyd, all_fields=True)
class SAMLConfigurationForm:
pass
This gets me halfway there, but strawberry.asdict
seems to be limited to snake-casing (or rather, limited to however the fields are cased on the SAMLConfigurationPyd
model in this example).
Would it be possible to support something like:
from pydantic.alias_generators import to_camel
strawberry.asdict(saml_configuration_form, alias_generator=to_camel)
That way I can easily inflect the serialized form's keys.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too