I think it's unreasonable to expect strawberry's mypy plugin to get this right, but a better error message would be helpful.
We use a library pydantic_sqlalchemy to dynamically create pydantic models based off our DB ORM models. I wanted to then take some of those and use them as strawberry input.
class MyAwesomePydanticModel(pydantic_sqlalchemy.sqlalchemy_to_pydantic(OrmModel)):
pass
@strawberry.experimental.pydantic.input( # Fails with 'Pydantic plugin not installed, please add pydantic.mypy your mypy.ini plugins'
model=MyAwesomePydanticModel, all_fields=True
)
class MyAwesomePydanticModelInput:
pass
I do have the pydantic plugin installed, but because of the magic in the middle, I'm assuming there's information lost. Leads to a befuddling error message.
The same error seems to appear if you try to use @strawberry.experimental.pydantic.input(model=NotPydanticModel)
So maybe something like
`No pydantic mypy information found for model XYZ. Please check that you have included pydantic.mypy in your mypy.ini plugins and that XYZ inherits from pydantic.BaseModel'
if there's no way to get a more granular cause of the error.
Low priority, but now at least there's something on google search if anyone else hits the same thing :)
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