Docs
Launch GraphOS Studio
Apollo Server 2 is officially end-of-life as of 22 October 2023. Learn more about upgrading.

File uploads in Node.js < v8.5.0


File uploads are supported in 2.x through the third-party

graphql-upload
package. While 2.x aims to support Node.js LTS versions prior to v8.5.0, the graphql-upload project no longer supports file uploads on versions of Node.js prior to v8.5.0 due to changes in the underlying architecture.

While Node.js versions prior to v8.5.0 are still under

from the Node.js Foundation, we encourage all users of Apollo Server to update to newer LTS versions of Node.js prior to the "end-of-life" dates for their current server version.

For example, while Node.js 6.x is covered by Long Term Support until April 2019, there are substantial performance (e.g.

improvements) and language changes (e.g. "modern" ECMAScript support) offered by newer Node.js engines (e.g. 8.x, 10.x). Switching to newer Long Term Support versions of Node.js comes with long-term benefits; Node.js 10.x LTS releases are covered by the Node.js Foundation through April 2021.

Since file upload support for Node.js versions prior to v8.5.0 is no longer offered by graphql-upload, users of those versions must disable file uploads to continue using newer 2.x versions.

To disable file uploads and continue using Apollo Server 2.x on Node.js 6.x, add the uploads: false setting to the options when constructing the server. For example:

const { typeDefs, resolvers } = require('./anOutsideDependency');
const server = new ApolloServer({
/* Existing Apollo Server settings — e.g. type definitions */
typeDefs,
resolvers,
/* Add this line to disable upload support! */
uploads: false,
/* ... other Apollo Server settings ... */
})

For additional assistance, please

or file a
new issue
on the GitHub repository.

Previous
Installing graphql-tools
Next
Migrating from the "engine" option
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company