Comments (6)
This question has been answered, but feel free to continue the conversation π
from graphql-multipart-request-spec.
In the early evolution of this spec/implementations there was no map
field; see https://github.com/jaydenseric/graphql-multipart-request-spec/tree/v1.0.0#multipart-form-field-structure.
Looking at your suggestion, the first observation is that you would lose the ability to manage the file upload streams in resolvers. Middleware would block the resolvers until all the files have be received and temporarily stored somewhere, either in memory or as temp files to populate (in your example) req.files
. This would mean you would not be able to get the nice second "Async" waterfall described in this diagram:
This would mean:
- Slower response time.
- More use of system resources.
- No ability to validate and abort uploads in resolvers.
In theory, if the scalars were able to reliably read the request context and they were able to return a promise, you might be able to remove the map
field. I don't think that is really doable though. The suggested global-request-context
solution is pretty dubious and requires special setup. Even if scalars had a context argument, people don't consistently attach the request
object to GraphQL context and some don't at all.
from graphql-multipart-request-spec.
I am getting error using above curl command
curl localhost:3007/graphql \
-F operations='{ "query": "mutation ($file: Upload!) { testUpload(file: $file) { id } }", "variables": { "file": "0" } }' \
-F [email protected]
{"errors":[{"message":"GraphQL Request must include at least one of those two parameters: "query" or "queryId"","category":"request"}]}
I am using webonyx/graphql-php library
from graphql-multipart-request-spec.
@gohelkiran30 that request is invalid, as it is missing the map
field. Regardless, it would be an issue to take up with your chosen implementation, not the spec itself.
from graphql-multipart-request-spec.
@jaydenseric I have tried it with map field also and the issue is same. I don't think the issue is with the implementation as its build on the graphql specifications.
I am using webonyx/graphql-php and Ecodev/graphql-upload library
from graphql-multipart-request-spec.
I don't think the issue is with the implementation as its build on the graphql specifications.
That sentence is hard to interpret. You mean to say that you are confident that the GraphQL server faithfully implements this GraphQL multipart request spec?
I can't help you problem solve implementations, you should create issues in the relevant repos if you think they have a bug.
from graphql-multipart-request-spec.
Related Issues (20)
- createReadStream is not a function HOT 1
- Request payload has no file content HOT 1
- Variable * got invalid value {}; String cannot represent a non string value: {} HOT 5
- βoperationsβ multipart field HOT 4
- I cant send one file and other data, like a string. HOT 6
- Ordered fields? HOT 1
- `map` field in context of backward compatibility HOT 2
- Payload modification HOT 4
- Simple alternative if you are not tied to the JS graphql ecosystem. HOT 3
- Spec Improvement for the broader GraphQL Ecosystem HOT 4
- Switch to the JSON Pointer standard for `map` field operations paths HOT 2
- Where I am wrong when I am using axios to upload file, Please help me. HOT 2
- You have to solve my problem. Please help me. HOT 3
- In your example you only show not nullable file upload system? HOT 1
- Issues with multiple file list example? HOT 3
- Conside using JsonPath for defining fiile field path. HOT 2
- Not able to upload image from React Ant to Node.js server via GraphQL HOT 1
- Not able to upload image from React Ant to Node.js server via GraphQL HOT 1
- README graphic is *somewhat* misleading regarding buffering HOT 2
- Content-Length or arbitrary headers HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-multipart-request-spec.