View more context

 

Firesphere

Just note, it'll be a new major number, because there are so many changes, so update your composer.json file where needed to 3.x 🙂

gened

Anyone built a File upload mutation in SS? This looks nice 🙂 https://blog.apollographql.com/file-uploads-with-apollo-server-2-0-5db2f3f60675

Show 1 attachment(s)
Apollo GraphQL  
File Uploads with Apollo Server 2.0

Learn how to upload files with Apollo Server and set it up on the client.

Hide attachment content
guywatson

Hi @gened I did this a while back. It worked pretty well for us

gened

Hah! I found "ecodev/graphql-upload": "3.0.0", plugin as well, and started down the psr7 adpater for SS route as well.. but gave up and just wrote my own middleware. Very nice

gened

@guywatson ^ but yeah so nice to have and UploadType rather than dealing with base64!

gened

Will be great if SS adopted this in the core

👍 (1)
blueo

ah interesting, I've done something like that before - made the request a multipart request with the file, created a 'file' type to hold the data. Went reasonably well. I think silverstripe uses a separate endpoint for file uploads

👍 (1)
gened

Maybe a custom OperationResolver like SilverStripe\GraphQL\Pagination\Connection ?

conrad

You can upload files in a graphql mutation by base64 encoding them first

👍 (1)
Firesphere

Good question... I'm way too busy to even have time 😣