-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension to bring back file upload support #638
Comments
Can someone please share the requirements for file uploads at runtime? I've never done it myself. |
hi, wdym by requirements? dependencies? |
Hey, I mean what does the implementation of file uploads need to do. Knowing details about that will help drive the extension design, because we'll know what kinds of knobs and levers need to be exposed. |
For one thing, you have to change the type of request that's made from normal JSON data to multipart/form-data, you need to replace files in the payload with a reference to the file, etc, which means recursively searching the body for files. It's not that hard, just fiddly to get everything 100%. See this code for reference: Written by @lynxtaa which uses https://www.npmjs.com/package/extract-files Spec: https://github.com/jaydenseric/graphql-multipart-request-spec |
Thanks, I'll check those links out when the time comes.
what would "payload" be and what would "files in payload" mean? Does recursively searching the body mean the graphql document selection set? |
By payload, I mean the object being POSTed; i.e. https://github.com/jaydenseric/graphql-multipart-request-spec?tab=readme-ov-file#file-list You can see the variables get swapped out for nulls, then a |
Yep, also please accept a Readable stream from node or the web api, loading the entire file in memory using a Buffer should be optional and not the only way. |
Perceived Problem
Loss of file upload support #400
Ideas / Proposed Solution(s)
The text was updated successfully, but these errors were encountered: