Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload files or images on hasura graphql engine

Tags:

hasura

Example:

  • upload file to server and save resulting path to the database, only authenticated users should be able to upload files

How to implement this?

like image 213
srghma Avatar asked Oct 09 '18 17:10

srghma


People also ask

What is Hasura GraphQL engine?

Hasura GraphQL Engine is an opensource product that connects to your databases & services and gives you a realtime GraphQL API, instantly.

What is metadata in Hasura?

We call the Hasura Server configuration the Metadata. All changes made to the Hasura instance via the Console or via the API such as tracking tables / views / custom functions, creating relationships, configuring permissions, creating event triggers and remote schemas, etc.

How do I deploy Hasura?

One-click Deploy on Render​ Make sure to create a free Render account first. Once you're logged into your Render account, click the button below to deploy Hasura and a new managed PostgreSQL database wired up to your Hasura instance. That's it! Read on to configure your Hasura instance.


1 Answers

to summarize we have 3 ways:

  • client uploads to s3 (or similar service), get's file url, then makes insert/update mutation to the right table
  • custom uploader - write application/server that uploads files and mutates db and use nginx routing to redirect some requests to it
  • custom resolver using schema stitching (example)
like image 88
srghma Avatar answered Oct 28 '22 06:10

srghma