René's URL Explorer Experiment


Title: Streaming file upload is not working · Issue #433 · graphql-python/gql · GitHub

Open Graph Title: Streaming file upload is not working · Issue #433 · graphql-python/gql

X Title: Streaming file upload is not working · Issue #433 · graphql-python/gql

Description: from gql import gql, Client from gql.transport.aiohttp import AIOHTTPTransport import aiofiles gql_query = gql(''' mutation create($input: ProductDocumentCreateMutationInput) { createProductDocument(input: $input) { productDocument{ id }...

Open Graph Description: from gql import gql, Client from gql.transport.aiohttp import AIOHTTPTransport import aiofiles gql_query = gql(''' mutation create($input: ProductDocumentCreateMutationInput) { createProductDocumen...

X Description: from gql import gql, Client from gql.transport.aiohttp import AIOHTTPTransport import aiofiles gql_query = gql(''' mutation create($input: ProductDocumentCreateMutationInput) { createPr...

Opengraph URL: https://github.com/graphql-python/gql/issues/433

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Streaming file upload is not working","articleBody":"```\r\nfrom gql import gql, Client\r\nfrom gql.transport.aiohttp import AIOHTTPTransport\r\nimport aiofiles\r\n\r\n\r\ngql_query = gql('''\r\n  mutation create($input: ProductDocumentCreateMutationInput) {\r\n    createProductDocument(input: $input) {\r\n        productDocument{\r\n           id           \r\n      }\r\n    }\r\n  }\r\n\r\nquery getProductDoc($id: ID!) {\r\n    productDocument(id: $id) {\r\n      id\r\n      file_category\r\n      file\r\n      }\r\n    }\r\n''')\r\n\r\nasync def stream_file(filepath):\r\n    async with aiofiles.open(filepath, \"rb\") as f:\r\n        while True:\r\n            chunk = await f.read(64 * 1024)\r\n            if not chunk:\r\n                break\r\n            yield chunk\r\n\r\ntransport = AIOHTTPTransport(\r\n            url='url',\r\n            headers={\"Authorization\": f\"Bearer {auth_token}\"},\r\n        )\r\nasync with Client(transport=transport, fetch_schema_from_transport=True) as gql_session\r\n        filepath = 'path/to/product_doc.pdf'\r\n        data = {\r\n                    \"user\": 'user_id',\r\n                   \"file_category\": 'product_doc'\r\n                    \"file\": stream_file(filepath),\r\n                }\r\n        \r\n        result = await gql_session.execute(\r\n                    gql_query,\r\n                    operation_name=\"create\",\r\n                    variable_values={\"input\": data},\r\n                    upload_files=True,\r\n                )\r\n```\r\nIn above I am trying to stream file upload as shown in the `gql` documentation. But I get following error\r\n\r\n```\r\n[ERROR] Exception: Failed to upload {'message': 'Must provide query string.'}\r\nTraceback (most recent call last):\r\nFile \"file_upload.py\", line 143, in main\r\nresult = await gql_session.execute(\r\nFile \"/usr/local/lib/python3.10/site-packages/gql/client.py\", line 1231, in execute\r\nraise TransportQueryError(\r\ngql.transport.exceptions.TransportQueryError: {'message': 'Must provide query string.'}\r\n\r\nDuring handling of the above exception, another exception occurred:\r\nTraceback (most recent call last):\r\nFile \"/usr/local/lib/python3.10/asyncio/runners.py\", line 44, in run\r\n  return loop.run_until_complete(main)\r\nFile \"/usr/local/lib/python3.10/asyncio/base_events.py\", line 649, in run_until_complete\r\n  return future.result()\r\n File \"file_upload.py\", line 148, in main\r\n  raise Exception(f\"Failed to upload {exp}\")\r\nException: Failed to upload {'message': 'Must provide query string.'}\r\n```\r\n\r\n**System info:**\r\n - OS: Ubuntu 22.04\r\n - Python version: 3.10\r\n - gql version: 3.4\r\n - graphql-core version: 3.2.3\r\n","author":{"url":"https://github.com/myscfwork","@type":"Person","name":"myscfwork"},"datePublished":"2023-09-07T21:13:10Z","url":"https://github.com/graphql-python/gql/issues/433"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:43359fc5-85e6-1e3e-2c4e-0e6d2c73baaf
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9856:2B9B04:1B20F5F:22F5ADB:6AFFC3BD
html-safe-nonce625351ab1ce572cdef10553975cb8be643dfc0363f13925aa1eb77499a05609c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODU2OjJCOUIwNDoxQjIwRjVGOjIyRjVBREI6NkFGRkMzQkQiLCJ2aXNpdG9yX2lkIjoiNzM1ODg1MzA4OTY1MjA5Nzk4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaccde89e079c16b1769142ec59601262b1e48173be67ea19b59de56d33af00d524
hovercard-subject-tagissue:1886570689
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/graphql-python/gql/433/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e4b7ce1e0dd0f9d10ae74d12b8d600eb16502dd429f46941f1e37fc86ab4a4fd/graphql-python/gql/issues/433
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e4b7ce1e0dd0f9d10ae74d12b8d600eb16502dd429f46941f1e37fc86ab4a4fd/graphql-python/gql/issues/433
og:image:altfrom gql import gql, Client from gql.transport.aiohttp import AIOHTTPTransport import aiofiles gql_query = gql(''' mutation create($input: ProductDocumentCreateMutationInput) { createProductDocumen...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemyscfwork
hostnamegithub.com
expected-hostnamegithub.com
None1e805b832df235bb21305db712c3b6432920019dfc12cb25b9cb8d3b0c9403cf
turbo-cache-controlno-preview
go-importgithub.com/graphql-python/gql git https://github.com/graphql-python/gql.git
octolytics-dimension-user_id15002022
octolytics-dimension-user_logingraphql-python
octolytics-dimension-repository_id62077169
octolytics-dimension-repository_nwographql-python/gql
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id62077169
octolytics-dimension-repository_network_root_nwographql-python/gql
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8fa4a54e6871c7908eda1c246ad5972982c0b59d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/graphql-python/gql/issues/433#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-python%2Fgql%2Fissues%2F433
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-python%2Fgql%2Fissues%2F433
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=graphql-python%2Fgql
Reloadhttps://github.com/graphql-python/gql/issues/433
Reloadhttps://github.com/graphql-python/gql/issues/433
Reloadhttps://github.com/graphql-python/gql/issues/433
graphql-pythonhttps://github.com/graphql-python
gqlhttps://github.com/graphql-python/gql
Codehttps://github.com/graphql-python/gql
Issues5 (5)https://github.com/graphql-python/gql/issues
Pull requests1 (1)https://github.com/graphql-python/gql/pulls
Actionshttps://github.com/graphql-python/gql/actions
Projectshttps://github.com/graphql-python/gql/projects
Security and qualityhttps://github.com/graphql-python/gql/security
Insightshttps://github.com/graphql-python/gql/insights
https://github.com/graphql-python/gql
New issuehttps://github.com/login?return_to=https://github.com/graphql-python/gql/issues/433
New issuehttps://github.com/login?return_to=https://github.com/graphql-python/gql/issues/433
Streaming file upload is not workinghttps://github.com/graphql-python/gql/issues/433#top
type: question or discussionIssue discussing or asking a question about gqlhttps://github.com/graphql-python/gql/issues?q=state%3Aopen%20label%3A%22type%3A%20question%20or%20discussion%22
https://github.com/myscfwork
myscfworkhttps://github.com/myscfwork
on Sep 7, 2023https://github.com/graphql-python/gql/issues/433#issue-1886570689
https://github.com/leszekhanusz
leszekhanuszhttps://github.com/leszekhanusz
on Sep 7, 2023https://github.com/graphql-python/gql/issues/433#issuecomment-1710889896
debug logshttps://gql.readthedocs.io/en/stable/advanced/logging.html#logging
https://github.com/myscfwork
myscfworkhttps://github.com/myscfwork
on Sep 8, 2023https://github.com/graphql-python/gql/issues/433#issuecomment-1711029819
https://github.com/leszekhanusz
leszekhanuszhttps://github.com/leszekhanusz
on Sep 8, 2023https://github.com/graphql-python/gql/issues/433#issuecomment-1711363712
https://github.com/myscfwork
myscfworkhttps://github.com/myscfwork
on Sep 12, 2023https://github.com/graphql-python/gql/issues/433#issuecomment-1715129210
https://docs.aiohttp.org/en/stable/client_quickstart.html#post-a-multipart-encoded-filehttps://docs.aiohttp.org/en/stable/client_quickstart.html#post-a-multipart-encoded-file
https://github.com/leszekhanusz
leszekhanuszhttps://github.com/leszekhanusz
on Sep 12, 2023https://github.com/graphql-python/gql/issues/433#issuecomment-1715556945
tests/test_aiohttp.pyhttps://github.com/graphql-python/gql/blob/master/tests/test_aiohttp.py
test_aiohttp_async_generator_uploadhttps://github.com/graphql-python/gql/blob/dfbcb59957b63a1eee8093603de28411b6457870/tests/test_aiohttp.py#L884
https://docs.aiohttp.org/en/stable/client_quickstart.html#post-a-multipart-encoded-filehttps://docs.aiohttp.org/en/stable/client_quickstart.html#post-a-multipart-encoded-file
the codehttps://github.com/graphql-python/gql/blob/dfbcb59957b63a1eee8093603de28411b6457870/gql/transport/aiohttp.py#L281
leszekhanuszhttps://github.com/leszekhanusz
type: question or discussionIssue discussing or asking a question about gqlhttps://github.com/graphql-python/gql/issues?q=state%3Aopen%20label%3A%22type%3A%20question%20or%20discussion%22
on Sep 12, 2023https://github.com/graphql-python/gql/issues/433#event-10345682673
leszekhanuszhttps://github.com/leszekhanusz
completedhttps://github.com/graphql-python/gql/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 13, 2023https://github.com/graphql-python/gql/issues/433#event-10364455056
https://github.com/myscfwork
myscfworkhttps://github.com/myscfwork
on Sep 18, 2023https://github.com/graphql-python/gql/issues/433#issuecomment-1723270825
@leszekhanuszhttps://github.com/leszekhanusz
https://github.com/leszekhanusz
leszekhanuszhttps://github.com/leszekhanusz
on Sep 18, 2023https://github.com/graphql-python/gql/issues/433#issuecomment-1724000676
leszekhanuszhttps://github.com/leszekhanusz
on Sep 19, 2023https://github.com/graphql-python/gql/issues/433#event-10406202012
leszekhanuszhttps://github.com/leszekhanusz
completedhttps://github.com/graphql-python/gql/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 19, 2023https://github.com/graphql-python/gql/issues/433#event-10414398207
https://github.com/RainerHausdorf
RainerHausdorfhttps://github.com/RainerHausdorf
on Apr 17, 2025https://github.com/graphql-python/gql/issues/433#issuecomment-2811996228
linehttps://github.com/graphql-python/gql/blob/dfbcb59957b63a1eee8093603de28411b6457870/gql/transport/aiohttp.py#L281
https://github.com/leszekhanusz
leszekhanuszhttps://github.com/leszekhanusz
on May 22, 2025https://github.com/graphql-python/gql/issues/433#issuecomment-2902825350
@RainerHausdorfhttps://github.com/RainerHausdorf
#549https://github.com/graphql-python/gql/pull/549
Sign up for freehttps://github.com/signup?return_to=https://github.com/graphql-python/gql/issues/433
Sign in to commenthttps://github.com/login?return_to=https://github.com/graphql-python/gql/issues/433
type: question or discussionIssue discussing or asking a question about gqlhttps://github.com/graphql-python/gql/issues?q=state%3Aopen%20label%3A%22type%3A%20question%20or%20discussion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.