trpc-rs

Crates.iotrpc-rs
lib.rstrpc-rs
version0.0.2
sourcesrc
created_at2022-06-24 17:15:36.709636
updated_at2022-06-26 00:11:46.263677
descriptionA blazing fast and easy to use TRPC server for Rust.
homepage
repositoryhttps://github.com/oscartbeaumont/trpc-rs
max_upload_size
id612525
size50,290
Oscar Beaumont (oscartbeaumont)

documentation

README

trpc-rs

🚧 Work in progress 🚧

A blazingly fast and easy to use TRPC server for Rust.

crates.io download count badge docs.rs

Example

You define a trpc router and attach resolvers to it like below. This will be very familiar if you have used trpc or GraphQL before.

let router = trpc_rs::Router::<()>::new()
    .query("version", |_| "0.0.1")
    .mutation("helloWorld", |_| async { "Hello World!" });

Features:

  • Per Request Context - Great for database connection & authentication data

Planned Features:

  • Batch queries

  • Merging servers

  • Middleware & Route Meta

  • Error Handling

  • Msgpack support

  • Unit test for exporting types and validating schema

  • Pass argument type earlier in query/mutation -> Expose this as helper which user can call

  • Subscriptions

  • Cleanup the codebase -> Currently their is a lot of duplicate code between mutations and queries. Add comments to everything!

  • Warn user when not all variants of enum were registered -> Make it so they can turn this into unit test

  • Passthrough Rust deprecated to Typescript doc comment

  • Input validation

  • Exporting input validation to frontend code so it can be reused

  • Fix ts-rs #70

  • TRPC Rust Client

  • Documentation

Commit count: 330

cargo fmt