Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 1.25 KB

ReadMe.md

File metadata and controls

17 lines (14 loc) · 1.25 KB

Apollo File Upload Example

A little demo of how Apollo Server can handle file uploads.

This demo uses Meteor, Apollo Client+Server and Multer to show one way to handle file uploads to an Apollo app. It is adapted from the tests written for Express-GraphQL.

Usage

  • After installing the dependencies, run meteor to get up and running.
  • Post to localhost:3000/graphql with something along the lines of these post body key/value pairs:
    • query : mutation newFile($fileName : String) { uploadFile(fileSaveName : $fileName) { originalname, mimetype}}
    • operationName : newFile
    • variables : {"fileName": "SaveNameForNewFile"}
    • file : Attach a file to be uploaded. This is most easily done using a "REST Client" like Postman.
  • In the future, the file upload field currently in the UI should hook into Apollo Client and perform the upload. At the moment, that file uploader is pretty useless.

Example Postman request.

An example request.