Coder Social home page Coder Social logo

Comments (2)

jaydenseric avatar jaydenseric commented on May 29, 2024

Current practice for file downloads is for queries to resolve URL strings for the client to be able to access the files as needed. You could setup an endpoint to serve the files from wherever they are hosted (AWS S3, DigitalOcean Spaces, etc.), or even better, use a service such as imgix.

An inferior alternative is to base64 encode the files so they can be queried as a string.

There might be something else I'm not imaginative enough to realize, but I don't think ideas such as sending multipart responses to the client will be viable. If someone else has a better imagination and can think of something viable, please share!

from graphql-multipart-request-spec.

chrisregnier avatar chrisregnier commented on May 29, 2024

Glad I looked through the closed issues to find this, cause I was just about to ask the same thing, however I'm not entirely sure whether my suggestion merits a complete new spec doc or if it makes sense to tie it in with uploads.

Anyways I was thinking that you could just add another var named 'selector' that defines a single json path into the result (although I could see an http header working as well). Then, since graphql apis would normally use Accept: application/json, you can look for Accept: application/octet-stream to know if you should be taking the result and using the selector to pull out the result and then return it as a binary file.

from graphql-multipart-request-spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.