scaphold-io / scaphold-issues

Post issues that you find on Scaphold here. Post anything about the platform, docs, boilerplates, etc... Happy Scapholding!
3 stars 0 forks source link

Custom backends for files #7

Open nelix opened 7 years ago

nelix commented 7 years ago

It would be nice to be able to get graphql to return placeholder images and image meta data like width and height so as to save page layouts and to draw placeholders.

vning93 commented 7 years ago

That's a great idea! Do you mean have default images for file types that a user inputs? Or have Scaphold provide stock placeholder images?

nelix commented 7 years ago

I mean if files are uploaded by a user, it would be nice to be able to request what size you get them back out as, would be great for things like responsive CMS.

vning93 commented 7 years ago

Ah great point, we can certainly include that in the base Blob interface. Thanks for the suggestion!

vning93 commented 7 years ago

On second thought, it might be easier to leave it as thin as possible on the Scaphold side, since not all File types are images. It could be a PDF, CSV, etc... So we don't want to make any assumptions past mimeType. I can definitely add file size (in Bytes) though.

The rest of the fields, you'll have to update and manage yourself to keep it generic for others.

tegument commented 7 years ago

for more control over image/media specific uploads, it might be best to integrate a 3rd party API like cloudinary with scaphold so that the image data is stored in scaphold but hosted by the 3rd party service: http://cloudinary.com/

mikeparisstuff commented 7 years ago

This is an interesting idea and one that we are definitely considering. Would love to hear more about what backends people are most interested in.

brandonmp commented 7 years ago

having the option of using scaphold as a passthrough to cloudinary would be handy (and in line with the '1 api for everything' vision you guys seem to have. though i'm not sure cloudinary is intended to be used with photos hosted elsewhere (as their prices likely include the storage you'd need).

re: default images, wouldn't a default value for the blobURL field be sufficient?

bkniffler commented 7 years ago

I'm definitely seconding cloudinary! My typical API would allow access to collections, auth and images (through cloudinary). So, being able to query images (including custom fields that can be stored in image metadata, e.g. https://support.cloudinary.com/hc/en-us/articles/202521142-Can-I-add-metadata-to-images-) or getting a signed key to upload images would be amazing.