Skip to content

Upload a file with Apollo #746

Answered by shreyas44
TomasMoskala asked this question in Q&A
Discussion options

You must be logged in to vote

@TomasMoskala You can find a ton of resources online regarding file uploads to GraphQL APIs. You can probably start with the apollo documentation and the graphql-upload docs which you seem to want to use. You could also use apollo-server-express, pass the request as part of the resolver context and you can interpret the request like you would a regular express request and get the file and upload it.

However, that being said I would advise against adding file upload to your GraphQL API in a production application for the main reason being that it adds a huge amount of load to the GraphQL server which needs to be super fast and responsive as most of your application would depend on it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TomasMoskala
Comment options

Answer selected by TomasMoskala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants