jaydenseric / graphql-multipart-request-spec

A spec for GraphQL multipart form requests (file uploads).
1.01k stars 56 forks source link

Variable * got invalid value {}; String cannot represent a non string value: {} #41

Closed murka closed 4 years ago

murka commented 4 years ago

I got error: Variable \"$uid\" got invalid value {}; String cannot represent a non string value: {}

My form-data of Body:

operations:{"query":"mutation($uid: String!, $photos: [Upload!]!) {\n  uploadPhotos(uid: $uid, photos: $photos)\n}", "variables": { "uid": null, "photos": [null, null, null]}}↵
map:{"0":["variables.uid"], "1":["variables.photos.0"], "2":["variables.photos.1"], "3":["variables.photos.2"]}
0:test

My Graphql mutation:

mutation UploadPhotos($uid: String!, $photos: [Upload!]!) {
  uploadPhotos(uid: $uid, photos: $photos)
}
flashcrow2000 commented 4 years ago

I am experiencing the same issue. Do we need to start the server in a specific way? I'm trying to add the upload functionality to an existing system, i'm not sure if the server config needs to be changed or not.

murka commented 4 years ago

@flashcrow2000, I don't know, I don't think the problem is in the server.

dmitry commented 4 years ago

@murka what server do you have?

mike-marcacci commented 4 years ago

Hi @murka, I suspect you meant to create an issue on the repo of whichever implementation you are using, although I don't think this issue has sufficient details to demonstrate the existence of a bug regardless of the tool you are using.

This repository is for the specification itself, which all implementations follow. You might want to consider closing this issue and moving it where it has a more complete context. 🙂

jaydenseric commented 4 years ago

Closing because as @mike-marcacci explained, this repo is not the right place for such an issue.

@murka a guess what your problem might be: It looks like you are trying to use a file for the uid variable instead of the string type it's expecting.