Closed sgehrman closed 5 years ago
After googling for a few hours, I figured it out. The docs aren't great.
const fileUploadOptions = {
maxFieldSize: 1024 * 1024 * 10
};
const server = new ApolloServer({
uploads: fileUploadOptions
});
@sgehrman - thanks for the report. Not sure how I missed this (my GitHub notifications have been having problems). This sounds like a bug in the sense that the error message is incorrect, even if the behavior (error if the field is too large) is correct.
@JacobT14 there are essentially 2 possibilities:
maxFieldSize
to Infinity
.
I've noticed that some jpgs I upload, I get this error: BadRequestError: Invalid JSON in the ‘operations’ multipart field (https://github.com/jaydenseric/graphql-multipart-request-spec).
Some jpgs work fine, also noticed gifs give the same error.