Rust / Hasura / GraphQL
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.
user
, with a id
column of type uuid
, and also a username
column of type text
.ADMIN_SECRET
and a JWT_SECRET
on the graphql engine, and share these with the Rust server as environment variables.schema.json
gq $HASURA_ENDPOINT -H "x-hasura-admin-secret: $ADMIN_SECRET" --introspect --format json > ./graphql/schema.json
cargo run
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"} |