Home / Companies / Apollo / Blog / Post Details
Content Deep Dive

File Uploads with Apollo Server 2.0

Blog post from Apollo

Post Details
Company
Date Published
Author
Prosper Otemuyiwa
Word Count
1,063
Company Posts That Month
2
Language
English
Hacker News Points
-
Post removed?
No
Summary

The Apollo Server 2.0 has been updated with a feature that allows file uploads in GraphQL, enabling developers to upload files as part of their mutations. This feature is based on the GraphQL multipart form requests specification and follows the client-server workflow for uploading files. The server returns an upload promise that resolves an object containing information about the uploaded file, such as its filename, mimetype, encoding, and stream. To use this feature, developers need to install the `apollo-upload-client` package and set up a schema with the `Upload` type. They can then send multipart requests in their mutations, which will be handled by the server-side resolver function. The client can validate the file before sending it to the server and handle multiple files or blobs using different approaches. A full-stack example is available on GitHub for developers to try out and learn more about this feature.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Developer Experience 1 18 13 11 -18%
Real-time 1 324 99 41 +6%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.