Skip to content

Commit e29f7a8

Browse files
davidnemecetripier
authored andcommitted
Fix import error for users who don't use pydantic (strawberry-graphql#3018)
1 parent 8db003c commit e29f7a8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

RELEASE.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Release type: minor
2+
3+
Fix import error in `strawberry.ext.mypy_plugin` for users who don't use pydantic.

strawberry/ext/mypy_plugin.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
)
5353
from mypy.typevars import fill_typevars
5454
from mypy.util import get_unique_redefinition_name
55-
from strawberry.experimental.pydantic._compat import IS_PYDANTIC_V1
5655

5756
# Backwards compatible with the removal of `TypeVarDef` in mypy 0.920.
5857
try:
@@ -64,8 +63,11 @@
6463
try:
6564
from pydantic.mypy import METADATA_KEY as PYDANTIC_METADATA_KEY
6665
from pydantic.mypy import PydanticModelField
66+
67+
from strawberry.experimental.pydantic._compat import IS_PYDANTIC_V1
6768
except ImportError:
6869
PYDANTIC_METADATA_KEY = ""
70+
IS_PYDANTIC_V1 = False
6971

7072

7173
if TYPE_CHECKING:

0 commit comments

Comments
 (0)