How to get Image records directly via GraphQL?

Hi there,

We are building a plugin for one of our clients, in it we need to display an image stored in Dato. The plugin is filling a field with JSON. In it, we allow the user to upload an image. Since the newly created image is not tied to a record, how are we getting the URL via GraphQL?
Somehow media is not listed in GraphQL.

Thank you
^ Peter Goes

Hello Peter!

Yes, you are right, unfortunately we don’t expose (yet) on GraphQL the uploads directly.

You should use the REST API to get the uploads for now. But am I right saying that if you are uploading the image from the plugin you should be able to get all the uploads as well?


I finally found dato.uploads. I did not know about that. That helps a lot.

I did not build the image upload functionality yet, I just experimented with displaying media in the plugin. I got that working now.


1 Like