Rust Hasura Save

Rust / Hasura / GraphQL

Project README

Rust + Hasura Rust

This is an example of a Rust server that functions as a remote schema for Hasura.

It demonstrates:

You can learn more about this stack from this talk.

Package Manager

Cargo

Setup

  • Your Hasura schema must have a table user, with a id column of type uuid, and also a username column of type text.
  • Set an ADMIN_SECRET and a JWT_SECRET on the graphql engine, and share these with the Rust server as environment variables.
  • Use graphqurl to generate schema.json
  • gq $HASURA_ENDPOINT -H "x-hasura-admin-secret: $ADMIN_SECRET" --introspect --format json > ./graphql/schema.json

Start

  • cargo run

Environment Variables

Key Example
PORT 8000
HASURA_ENDPOINT http://127.0.0.1:8080/v1/graphql
ADMIN_SECRET foo
JWT_SECRET {"type":"HS256","key":"3QQ6FD+o0+c7tzQQVfjpMkNDi2yARAAKzQQk8O2IKoxQQ4nF7EdAh8s3TwpHwrdQQ6R"}
Open Source Agenda is not affiliated with "Rust Hasura" Project. README Source: ronanyeah/rust-hasura
Stars
139
Open Issues
0
Last Commit
2 years ago
License

Open Source Agenda Badge

Open Source Agenda Rating