graphene-pydantic
graphene-pydantic copied to clipboard
Correct handling of python reserved keywords
Hey.
Is there a way to handle reserved keywords in schema?
Pydantic model that works fine:
class Model(BaseModel):
class_: str
class Config:
fields = {
'class_': 'class'
}
But with this model, graphene don't see field named class
. Only class_
.
@MaximZemskov Yep, right now graphene-pydantic
doesn't correctly account for the alias
value on a Field; since this might involve changing the way attributes are looked up, it might be a significant change. Would you be interested in helping with a pull request?
Yeah, I could try
@MaximZemskov any of us would be very happy to help you with anything you need :smile:
Thanks. Will have a look at the weekend
@MaximZemskov FYI: I created PR for this issue. please test its branch and feel free to comment.