Skip to content

Instantly share code, notes, and snippets.

@plinionaves
Created March 6, 2020 03:40
Show Gist options
  • Save plinionaves/8dccd96f97dceb0cc8a4093715332183 to your computer and use it in GitHub Desktop.
Save plinionaves/8dccd96f97dceb0cc8a4093715332183 to your computer and use it in GitHub Desktop.
Snippets para Upload com GraphQL | Curso GraphQL APIs com Node, MongoDB, Mongoose, Redis, GraphQL Yoga

GraphQL Upload (single)

  • operations
{  
  "query": "mutation SingleUpload($data: UploadCreateInput!) { singleUpload(data: $data) { filename } }",
  "variables": {
    "data": {
      "file": null
    }
  }
}
  • map
{
  "photo": ["variables.data.file"]
}
  • photo Campo no multipart/form-data que vai conter o arquivo (pode ser qualquer nome)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment