Skip to main content

Accessing and upload files using the GraphQL API

  • March 30, 2020
  • 29 replies
  • 28407 views

Show first post

29 replies

dipro
Forum|alt.badge.img
  • Author
  • Leader
  • May 22, 2020

Hey @juan1 – this is a specific way that our file uploads don’t conform exactly to the GraphQL spec, and is a known issue. You can still upload files, but you should use the key variables[file] for your file data. More generally, you should use variables[variable_name](it doesn’t need to be “file”,

Here is some example code that uploads a file “the hard way” (by constructing the multipart from scratch). I hope you find it helpful!

Side note about this thread:

I’m noticing that this thread has a lot of different topics in it, and will be closing it in 24 hours. If you have a side topic related to file uploads, I would recommend opening a new thread in the community (don’t be shy).

While I love the discussion, I want to ensure our community stays organized. Opening new threads will ensure no one’s questions get lost – and new members of the community can get value out of the discussion here without getting sidetracked! 🔮


juan1
  • Participating Frequently
  • May 22, 2020

@dipro

oh my 🙈. Is there any chance you have a javascript client-side example? I would be very grateful for that and I think many people could profit form this 😇


dipro
Forum|alt.badge.img
  • Author
  • Leader
  • May 22, 2020

I don’t think you can upload files from the client side, since it’ll be blocked by CORS.

If you’re building a client side app though, I’d highly recommend our Javascript SDK (documentation). It contains methods to make API requests and alongside our new apps framework you can do cool stuff with native board views and widgets. 🙌


dipro
Forum|alt.badge.img
  • Author
  • Leader
  • May 23, 2020

This topic was automatically closed after 32 hours. New replies are no longer allowed.