/gql-diesel-actix-rust

An example Rust GraphQL server running Actix, Juniper and DIesel with R2D2

Primary LanguageRustBSD 2-Clause "Simplified" LicenseBSD-2-Clause

🦀 Rust + Actix + Juniper (GraphQL) + Diesel + R2D2

🧰 Built with

💻 Local Setup

  • Make sure rust is setup first
  • Install/Update GCC brew install gcc
  • Install/Update libpq brew install libpq
  • Install the diesel cli RUSTFLAGS='-L /opt/homebrew/opt/libpq/lib' cargo install diesel_cli --no-default-features --features postgres
  • Copy .env-sample to .env and define required values
  • Apply database migrations diesel migration run

📖 Commands

Command Purpose
cargo run Run development server
diesel migration generate [name] Create migration

Notes

M1 users you might need add export RUSTFLAGS='-L /opt/homebrew/opt/libpq/lib' to your bash profile