Skip to content

BadRequestError: Missing multipart field ‘operations’ #115

@JaredPotter

Description

@JaredPotter

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions