pydanticpython-3.9python-poetrystrawberry-graphql

AttributeError: module 'strawberry.experimental' has no attribute 'pydantic'


I recently upgraded to python 3.9.17 from 3.7.11 and changed poetry version to 1.3.2 . However I am getting errors when I am trying to run that application. I am using strawberry-gql too

However I am getting

AttributeError: module 'strawberry.experimental' has no attribute 'pydantic'

in the place where I have

@strawberry.experimental.pydantic.type(model=DsccError, all_fields=True)

Is pydantic moved to something else from experimental


Solution

  • Yo, pydantic as moved to v2 with some breaking change, check your installed version and fallback to 1.10