Closed mdcarter closed 3 years ago
Seems this is caused by a recent version of apollo-server-express, we just upgraded to a newer version and ran into this problem
https://github.com/profusion/apollo-federation-file-upload/issues/31#issuecomment-888658003
Following this resolved it for us -- we needed to add the app.use(graphqlUploadExpress());
graphql-upload
exports a very simple graphqlUploadExpress
function to create express
middleware; I don't think anyone here is confused how to use the graphql-upload
API which is what I'm here to support. The confusion seems to be based around how to use Next.js and flavors of Apollo Server. The Next.js repo discussions has a help category. The best place to ask for help about Apollo products is through Apollo repos or support channels. Apollo has had $1.5 billion of funding to document their products and support their users; I get paid nothing each time I help them out.
These are not questions with answers I know off the top of my head that I can help out with as a quick favor. If anyone knows the answers, feel free to comment solutions.
One piece of advice; don't build your GraphQL API in the same project as an app. Keep the GraphQL API separate with it's own package.json
dependencies and deployments. A GraphQL API is a long term investment and can be used to power multiple generations of apps. Ideally you can work on multiple apps at the same time even. You don't want to end up in a situation where your GraphQL API gets hacked via a compromised npm package that's one of the many thousands of dependencies of your Next.js app. You also don't want to have the nightmare of untangling your app dependencies, tooling and code from the API stuff when the app becomes legacy and you want to replace it.
Hello everyone,
I have a next.js application running with an apollo server running inside of it. I'm trying to get the upload functionnality up and running but I don't understand where is my issue. I either have a timeout error when uploading, or this issue :
POST body missing, invalid Content-Type, or JSON object has no keys.
Here is a simplified version of my server for you to see :
I tried to apply the middleware everywhere I could think of but no luck, if you guys could give me a hand that would be great, thank 🙏