If anyone’s interested in an file handling impleme...
# prisma-whats-new
m
If anyone’s interested in an file handling implementation for prisma, graphql-yoga, and s3 using
apollo-upload-server
and
apollo-upload-client
here’s an example repo: https://github.com/manticarodrigo/prisma-s3. I’ll be posting a tutorial soon!
👍 1
👌 1
prisma 1
n
woop woop! 😄 what are the differences to https://github.com/graphcool/prisma/tree/master/examples/file-handling-s3? feel free to share here as well: https://www.graph.cool/forum/c/show-tell 🙌
m
The current example uses fetch on the client side to upload. I rewrote it to use `graphql-yoga`’s built-in
apollo-upload-server
so that files can be sent via client-side through a mutation and then handled on the server-side. This way we are abstracting away the s3 upload part to the server. One limitations to this is not having a way of keeping track of upload progress unless a subscription is created for it. An advantage is sending the mutation with the file simultaneously instead of waiting for file upload. I’ll share on Graphcool Forum once my tutorial is up explaining it in better detail!
parrotwave6 2
👌 3
n
Sounds good! 🙂
l
I've been thinking about the subscription problem. If we can assume one upload event at a time per client, we can give the client a UUID +
upload
as a channel and update the pubsub from the mutation resolver
m
@lawjolla sounds like you’re on the right track. That would be great to see!
b
@harmony for when we implement this feature in our app
m
Here’s the tutorial https://manticarodrigo.com/file-handling-s3-prisma-graphql-yoga/. About to post in forums.
parrotwave6 2
l
I'm hoping to get an uploading progress PR this weekend
m
Awesome @lawjolla. Keep us posted!