Giter VIP home page Giter VIP logo

Comments (4)

HriBB avatar HriBB commented on March 29, 2024

I am very interested in both apollo server and client supporting file uploads. I was a bit surprised when I found out that there is literally no documentation or examples out there.

+1 from me, unless someone is able to convince me otherwise ;)

from apollo-server.

helfer avatar helfer commented on March 29, 2024

@HriBB Feel free to give it a try with a PR for the server side!

from apollo-server.

HriBB avatar HriBB commented on March 29, 2024

@helfer and anyone else interested in this ... before I start hacking away, I just want to make sure I am going into the right direction.

I believe that this should be implemented in each integration separately, unless we can use the same multipart/form-data parser on all of them? What do you think?

So for apolloKoa for example, I would add a check for multipart/form-data before the ctx.request.body check here. If it is indeed multipart/form-data request, then store uploaded files into tmp folder (or use streams?), read other params (query, operationName, variables) from request and pass everything to runQuery.

Not really sure how to pass uploaded files to the resolvers. Through variables or maybe context? I am still not 100% sure I understand context completely ...

Anyway, this is the plan. What do you think? Please let me know if I am on the right track or not.

from apollo-server.

helfer avatar helfer commented on March 29, 2024

I wrote some comments in your PR. I think the best way would be to first make a PR with a clean failing test (inspired by the one from express-graphql). After that we can make separate PRs with implementations in Express, HAPI and Koa.

from apollo-server.

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.