A Rust server example implementing a remote schema for Hasura with JWT authentication and typesafe GraphQL.
Rust-Hasura is an example Rust server that functions as a remote schema for Hasura, extending its GraphQL API with custom authentication and business logic. It demonstrates how to implement user login, signup, and JWT-based authorization in a typesafe manner. The project serves as a reference for integrating Rust microservices with Hasura's GraphQL engine.
Developers building GraphQL backends with Hasura who want to add custom Rust-based microservices for authentication or other business logic. It's particularly useful for those seeking type-safe and secure integrations.
It provides a production-ready example of secure authentication and type-safe GraphQL operations in Rust, following Hasura's best practices. Developers choose it for its clear implementation of JWT authorization and seamless remote schema integration.
Rust / Hasura / GraphQL
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages the graphql_client crate for compile-time validation of GraphQL queries and mutations, reducing runtime errors and ensuring robustness as shown in the README.
Implements JWT authorization with refresh cookies following Hasura's best practices, providing a secure session management example referenced in the blog post link.
Acts as a remote schema to extend Hasura's GraphQL API, demonstrating a clean integration for adding custom business logic in Rust.
Based on established practices with environment variable management and documentation links, serving as a reliable blueprint for real-world deployments.
Requires a specific 'user' table with 'id' and 'username' columns in Hasura, limiting flexibility for projects with different data models, as admitted in the setup instructions.
Involves manual steps like generating schema.json with graphqurl and configuring multiple environment variables, which can be error-prone and time-consuming for newcomers.
Focuses only on authentication; users must extensively modify the codebase for other business logic, increasing initial development effort beyond the provided example.