-
Notifications
You must be signed in to change notification settings - Fork 226
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
file upload support #503
Comments
Hi, @quanduoling ! I have been dealing with the same issue recently. Sangria doesn't have file upload support, so I decided to show you what I came up with. I am using PlayFramework, so here is the gist with all the code that you need to implement something similar. To give you some understanding where the idea came from: my team is developing UI with typescript+react+apollo and I stumbled upon this post in Apollo blog with reference to this specification for graphql uploads. This approach has been already implemented for UI with apollo-upload-client lib and I decided to embed this specification into my server-side scala app. Hope you find this useful! |
In our experience, running sangria in our GraphQL gateway at NewWork SE, it's not a concern that's easily solved within the engine itself. The request patterns are very different for uploads, and you'll end up in a situation where you can't feasibly optimize for all of those. Uploads tend to be slow and they tend to hog bandwidth and threads. What worked well is to use mutations, to hand out signed URLs, to an upload service. It could for example be an S3. |
hi,i am wondering how can i upload file elegantly by using sangria. as now i am using flutter graphql on client side, it do this like https://codinglatte.com/posts/flutter/flutter-and-graphql-how-to-upload-files/ . is there any implemention in sangria on server side?
The text was updated successfully, but these errors were encountered: