How can i upload file using angular 5 + Apollo client using apollo express and Node
you can use this lib https://github.com/jaydenseric/apollo-upload-client
I can`t find reliable example with apolllo-upload-client and express-graphql
using apollo express
This is the repo for express-graphql, a different GraphQL server to Apollo Server for Express.
Regardless, you will be interested in checking out graphql-upload - it supports both of these GraphQL servers and more.
@ChampTiravat is right, if you are using Apollo Client you can use apollo-upload-client.
Example from the graphql-upload docs:
const express = require('express');
const graphqlHTTP = require('express-graphql');
const { graphqlUploadExpress } = require('graphql-upload');
const schema = require('./schema');
express()
.use(
'/graphql',
graphqlUploadExpress({ maxFileSize: 10000000, maxFiles: 10 }),
graphqlHTTP({ schema })
)
.listen(3000);
Most helpful comment
Example from the
graphql-uploaddocs: