Skip to content

Latest commit

 

History

History

apollo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Apollo Server Graphql Upload Example

This example shows how to use graphql-upload-ts with Apollo Server.

Usage

# Install dependencies
yarn install

# Start the server
yarn start

# Test upload with cURL ( successful upload as server accept only mime type image/png)
./upload.sh http://localhost:4000/graphql test.png

# Test upload with cURL ( failed upload / throw exception as server reject mime type image/jpeg)
./upload.sh http://localhost:4000/graphql test.jpg

OR Open http://localhost:4000/graphql in a browser to use GraphQL Playground

and run the uploadFile mutation with the test.png file as images below

Upload File Mutation1 Upload File Mutation2