-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upload large file causing Error: "Payload content length greater than maximum allowed: 1048576" #3354
Comments
You have syntax errors in your Apollo Server Setup, but you've also left off the important bit after that to see how you're using Regardless, 1MB is the default limit by Hapi 17. If you want to change it — much like any Hapi middleware — you'll need to adjust Hapi's For serverApollo.applyMiddleware({
app,
route: {
payload: {
maxBytes: 52428800,
},
},
}); If you have any other questions, please ask in the Apollo Server channel of Apollo's Spectrum.chat. |
here is my full apollo server setup code const serverApollo = new ApolloServer({
typeDefs,
resolvers,
schemaDirectives,
formatError,
uploads: {
maxFieldSize: 52428800, //bytes = 50MB
maxFileSize: 52428800,
maxFiles: 10
}
});
await serverApollo.applyMiddleware({
app,
route: {
payload: {
maxBytes: 52428800
}
}
});
await serverApollo.installSubscriptionHandlers(app.listener); after passing my setup is much like this |
I see. As we move toward Apollo Server 3.x, we won't be able to give this any attention ourselves. If this is important to you, we would accept a PR which (cleanly) splits the route registration into separate apollo-server/packages/apollo-server-hapi/src/hapiApollo.ts Lines 36 to 39 in aa3e23d
It should also add tests. If that's something you're willing to do, I'd encourage you to first try it locally to ensure it will work, prior to opening the PR. |
Yes, I'm facing exact same error. |
Apollo Server Setup
Package name
"hapi": "^17.8.5"
"apollo-server-hapi": "^2.4.8"
Actual Behavior
Less then 1MB File is uploading successfully. If the file size is gather then 1MB then i get the response is as given bellow.
Expected Behavior
I expect file uploads as described in the "File uploads" documentation to work with apollo-server-hapi.
The text was updated successfully, but these errors were encountered: