Create a File Upload API in GraphQL using Hasura Actions

preview_player
Показать описание
In this video, learn how to create a file upload API using Hasura Actions. The custom mutation accepts a base64 encoded version of the file to store it in the filesystem.

The Hasura Action handler is written using nodejs-express.

-----

🚀 Hasura makes your data instantly accessible over a real-time GraphQL API, so you can build and ship modern apps and APIs faster. Hasura connects to your databases, REST servers, GraphQL servers and third party APIs (eg: Stripe, Salesforce) to provide a unified realtime GraphQL API across all your data sources instantly.

-----
Рекомендации по теме
Комментарии
Автор

It isn't a good practice when you encode files to base64. My opinion is upload the file directly to the storage service and after that update the Hasura db.

tanhnguyen
Автор

I really don’t get how, the node ja server is connected to hasura, how does the mutation have access to the express function...

gianlucasantos
Автор

Thanks for this. But I could not grasp the point of using actions? It seems like an extra, unnecessary step? Wouldn't it be easier to just transform the data completely in the cloud function before mutating the auto-generated API directly?

tobias
Автор

if i want to learn from scratch and be able to connect with reactjs where should i look

thibao
Автор

Did you even use the action?
You created it but in the end your React frontend was making a request to a different backend and not the hasura engine.
Hmmmm

atemrandyasong
join shbcf.ru