Using computable properties or methods of the pydantic model instead of strawberry.field
class User(BaseModel):
first_name: str
last_name: str
def full_name(self, separator: str) -> str:
return f"{self.first_name}{separator}{self.last_name}"
@strawberry.experimental.pydantic.type(model=User, all_fields=True)
class UserType:
pass
Now the scheme looks like this:
type UserType{
first_name: String!
last_name: String!
}
But it would be convenient to have a scheme that looks like
type UserType{
first_name: String!
last_name: String!
full_name(separator: String!): String!
}
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