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

Rust + Hasura Rust server that functions as a Hasura

Rust + Hasura

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

It demonstrates:

  • user login + signup
  • JWT authorization w/ refresh cookie
  • typesafe GraphQL requests
  • uuid package integration

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"}

Information - Updated Sep 09, 2021

Stars: 90
Forks: 8
Issues: 0

GraphQL server library for Rust

GraphQL is a data query language developed by Facebook intended to

GraphQL server library for Rust

A GraphQL server library implemented in Rust

A high performance graphql server that's easy to use and has tons of examples and tutorials

A GraphQL server library implemented in Rust

A typed GraphQL client library for Rust

Precise types for query variables and responses

A typed GraphQL client library for Rust

Canduma rust Graphql

A Rust authentication server with GraphQL API, Diesel, PostgreSQL session authentication and JWT

Canduma rust Graphql

async GraphQL extension with Apollo tracing

A extension for Rust that makes async GraphQL a snap to learn

async GraphQL extension with Apollo tracing

Example using Rust Actix-web (web framework) with juniper (Graphql) with diesel (ORM)

Diesel's Getting Started guide using SQLite for Actix web

Example using Rust Actix-web (web framework) with juniper (Graphql) with diesel (ORM)

graphql-engine-rs

The Hasura GraphQL Engine - in Rust

graphql-engine-rs

Rust tooling for low-level manipulation of the GraphQL language

This repository is a work in progress, and we do not recommend to use it in production

Rust tooling for low-level manipulation of the GraphQL language

rust-graphql-test

A test GraphQL API using actix-web and async-graphql

rust-graphql-test

Myoxine is a (planned) blazing-fast GraphQL runtime to design web applications which run using Rust

Myoxine relies on Yew, a framework for building web applications in Rust

Myoxine is a (planned) blazing-fast GraphQL runtime to design web applications which run using Rust
Facebook Instagram Twitter GitHub Dribbble
Privacy