Closed DGolubets closed 1 week ago
Hi there!
Thanks for the issue. I have just created a pull request that should fix this : #64 .
Arguments now automatically aliases arguments when the stylers version doesn't match the original field_name
Here:
class Arguments(BaseModel):
user_id: str = Field(alias="userId")
As this may introduce some inconveniences when parsing arguments, this PR also introduce a new operations plugin option:
- type: turms.plugins.operations.OperationsPlugin
arguments_allow_population_by_field_name: True #default is false
class Arguments(BaseModel):
user_id: str = Field(alias="userId")
class Config:
allow_population_by_field_name= True
Which allows population like this: "QueryName.Arguments(user_id=3)" on to op "QueryName.Arguments(userId=3)"
Feel this is not the smoothest solution though, any ideas on that?
Hi!
Thank you for tackling this issue so quick. This looks good.
What's the downside of having arguments_allow_population_by_field_name
true by default?
Hi @DGolubets, i am closing this issue now, which i should have done a while ago :D hope everything still works for you, this should now be fixed in 0.6.0 that relies on pydantic v2 as well :)
Hi,
It seems that there is some inconsistency in arguments casing when using the Func plugin.
I use the following config:
I got this Arguments class generated:
But my query uses
$userId
.