Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 802 Bytes

readme.md

File metadata and controls

25 lines (17 loc) · 802 Bytes

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