-
Notifications
You must be signed in to change notification settings - Fork 114
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
Implement Upload spec #139
Comments
I think this was implemented in the gqlgen test client in 99designs/gqlgen#1661 and shouldn't be too difficult to accomplish here. |
Neat idea! We'll need to figure out what the API should look like: is a file just an |
The gqlgen file upload example README breaks down what the expected Request payload should look like and how to construct it using curl. The Then there is some extra stuff to dedupe file uploads in the variables & request, so a duplicate file can be referenced multiple times within the variables, but exist once in the The
Yes, but only for the content of the File. Some other custom type would be needed to let the developer fill in the blanks or you set them to be unique/random assuming they do not care about the filename within the body of the request.
Then you may end up dropping support for an array of files in your request variables; e.g. https://github.com/99designs/gqlgen/blob/master/_examples/fileupload/readme.md#file-list
It depends on how you construct your request and provide variables. If the developer provide the whole An b, _ := ioutil.ReadFile(fileData[0].file.Name()) // Bravo file content. Which is used to fill out this example part of the
The Also,
A 'multipart/form-data' GraphQL request puts the query in the
No not really. Filling the blanks for That map can be a bit tricky, since it should accommodate for the following:
// --b7955bd2e1d17b67ac157b9e9ddb6238888caefc6f3541920a1debad284d
// Content-Disposition: form-data; name="map"
//
// `{ "0":["variables.input.file"] }`
// or
// `{ "0":["variables.input.files.0"], "1":["variables.input.files.1"] }`
// or
// `{ "0": ["variables.input.0.file"], "1": ["variables.input.1.file"] }`
// or
// `{ "0": ["variables.req.0.file", "variables.req.1.file"] }` |
It would be really nice to implement the graph multipart spec in order to be able to test it.
The text was updated successfully, but these errors were encountered: