strawberry-graphql/strawberry

Pyright type issue with strawberry.file_uploads.Upload

axiomofjoy opened this issue · 1 comments

Describe the Bug

VSCode and Pyright give me red squiggly lines when using strawberry.file_uploads.Upload.

Repro:

Save a file with the contents:

from strawberry.file_uploads import Upload


async def read(f: Upload) -> bytes:
    data = await f.read()
    return data

Then run pyright on this file. You will see something like

/Users/xander/memly/backend/scratch2.py
  /Users/xander/memly/backend/scratch2.py:5:5 - error: Type of "data" is unknown (reportUnknownVariableType)
  /Users/xander/memly/backend/scratch2.py:5:18 - error: Type of "read" is unknown (reportUnknownMemberType)
  /Users/xander/memly/backend/scratch2.py:5:20 - error: Cannot access member "read" for type "Upload"
    Member "read" is unknown (reportAttributeAccessIssue)
  /Users/xander/memly/backend/scratch2.py:6:12 - error: Return type is unknown (reportUnknownVariableType)
4 errors, 0 warnings, 0 informations

System Information

  • Operating system: MacOS
  • Strawberry version (if applicable): strawberry-graphql==0.219.2

Additional Context

Screenshot 2024-02-14 at 11 13 05 PM

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

I'm running strict mode. It looks like that's not currently supported. Any plans to support?