strawberry-graphql / strawberry-django

Strawberry GraphQL Django extension
https://strawberry.rocks/docs/django
MIT License
415 stars 121 forks source link

`Cannot find reference 'django' in '__init__.py'` in PyCharm #168

Open patrick91 opened 2 years ago

patrick91 commented 2 years ago

using strawberry.django.type shows the following error/warning in PyCharm:

Cannot find reference 'django' in '__init__.py'

can we do anything to fix this?

Upvote & Fund

Fund with Polar

bellini666 commented 2 years ago

@patrick91 so strange that PyCharm behaves that way. Pyright does work correctly for this case (don't know about mypy though)

Obviously once this is merged into the monorepo it will be fixed, but for know we would need to know how pycharm considers typings for that specific case, where we basically import something that might or might not exist into the module namespace. Or maybe it should be already doing that bug there's a bug in how pycharm behaves?

bellini666 commented 3 weeks ago

@patrick91 do you know if this is still an issue? It's been a while now, maybe pycharm improved that?

I don't have pycharm so I don't know how to test this