-
-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
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
Better pyright support for pydantic conversion #1834
Comments
I have a similar issue:
This gives the mypy |
@bugzpodder could i understand abit more of your usecase? could domain be a property on the pydantic type instead? or is that just an example, and domain would actually send a request. |
This is just an example. In my case, I have two microservices A and B. |
Same issue here. class CurrentUser(pydantic.BaseModel):
email: str
@strawberry.experimental.pydantic.type(model=CurrentUserPyd, all_fields=True)
class CurrentUser:
pass assert isinstance(registered_user, CurrentUser)
result: ExecutionResult = await schema.execute(
mutation,
variable_values={"form": {"email": registered_user.email}},
context_value={"request": request, "response": response, "username": None},
) Pyright complains it doesn't know the
|
@mecampbellsoup I don't think we can fix this unfortunately :( This might be fixed/worked-around by supporting this (which we want to do in #2181) @strawberry.pydantic.type
class CurrentUser(pydantic.BaseModel):
email: str |
it only works with fields that are defined, so yeah, let's do it in another issue :)
Originally posted by @patrick91 in #1832 (comment)
Upvote & Fund
The text was updated successfully, but these errors were encountered: