question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BadRequestError: Missing multipart field ‘operations’

See original GitHub issue

Hello there,

I’ve been struggling to get apollo-upload-server working in my local environment, along side apollo-upload-client inside my vue.js app. I’ve had graphql using express working no problem and only have this issue when I added apollo-upload-server/client. I can run non-file mutations and they go through fine. But with a file mutation, I continually get the error BadRequestError: Missing multipart field ‘operations’.

I believe the error is happening on the server. I’ve narrowed down to just running:

import express from 'express'
import graphqlHTTP from 'express-graphql'
import { apolloUploadExpress } from 'apollo-upload-server'
import schema from './schema'

express()
  .use(
    '/graphql',
    apolloUploadExpress({ maxFileSize: 10000000, maxFiles: 10 }),
    graphqlHTTP({ schema })
  )
  .listen(3000)

And I still get the error, even when using curl. One thing I did notice was that in my vue app, on the first request there was an empty body for where the file contents were supposed to go. But again, in theory, curl failing means it is still the server and not the client.

Any help would be greatly appreciated!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
Enmanuellperez98commented, Jul 25, 2021

I solve it, by adding uploads: false: const server = new ApolloServer({ uploads:false, schema, playground: true });

3reactions
gaspancommented, Jan 21, 2020

@intellix did it work?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Relay Modern BadRequestError: Missing multipart field ...
js for uploading it server throws following error. BadRequestError: Missing multipart field 'operations' (https://github.com/jaydenseric/graphql ...
Read more >
File uploads - graphql-compose
apollo-upload-server - for parsing multipart/form-data POST requests via busboy and providing File s data to resolve function as argument. Tutorial. 1.
Read more >
File Upload - gqlgen
Graphql server has an already built-in Upload scalar to upload files using a multipart request. It implements the following spec ...
Read more >
Unable to upload file Instream to a Custom API using Multipart ...
Error 1: Multipart field missing 'Operation' Error 2: Misordered multipart fields; files should follow 'map'. Sample Code :.
Read more >
graphql-upload - npm
Clients implementing the GraphQL multipart request spec upload files as Upload ... Once the operations and map fields have been parsed, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found