How Hasura Storage works for uploading and retrieving files
mainHasura Storage acts as a middleware between your users, Hasura, and an S3-compatible storage service. It leverages Hasura's GraphQL API to enforce permissions and manage file metadata.
Upload Workflow
- Permission Check: The service asks Hasura if the user has permission to upload.
- S3 Upload: If permitted, the file is uploaded to the S3-compatible service.
- Metadata Storage: Upon successful S3 upload, the file's metadata is stored in Hasura via GraphQL.
- Response: The user receives the file metadata.
Retrieval Workflow
- Permission Check: The service asks Hasura if the user has permission to access the specific file.
- S3 Fetch: If permitted, the service requests the file from S3.
- Response: The file is streamed back to the user.