Seich / exograph

Build production-ready backends in minutes

Home Page:https://exograph.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exograph

Exograph is a declarative way to create flexible, secure, and performant backends that provide GraphQL query and mutation APIs. Exograph lets you focus on your domain model and business logic, freeing you to pursue more creative work on your application. Furthermore, it offers tooling to support all stages of the development lifecycle, from development to deployment to maintenance.

Installation

Get started by following the Getting Started guide.

Development

Prerequisites

Must have:

Nice to have:

  • cargo-watch (cargo install cargo-watch)

Installing the vscode extension

Follow the instructions in Exograph VSCode Extension repo.

Building

Build the exo and exo-server binaries:

cargo build

To create a production build:

cargo build --release

By default, cargo will build the exo-server binary with statically linked plugins. If you want to build a binary that dynamically links these plugins, you can use the --no-default-features flag:

cargo build --no-default-features

You can also selectively enable static linking for either Postgres or Deno:

cargo build --no-default-features --features static-postgres-resolver
cargo build --no-default-features --features static-deno-resolver
cargo build --no-default-features --features static-wasm-resolver

Running tests

Unit tests

cargo build && cargo test

Integration tests

cargo build && EXO_RUN_INTROSPECTION_TESTS=true cargo run --bin exo test integration-tests

Testing the setup

Yolo mode

cd integration-tests/basic-model-no-auth
cargo run --bin exo yolo

You will see URLs for the GraphQL playground and GraphQL endpoint. You can use the playground to run queries and mutations against the endpoint.

Dev mode

  1. Switch to an example Exograph project directory (such as integration-tests/basic-model-no-auth)
cd integration-tests/basic-model-no-auth
  1. Create a test database and update its schema
createdb concerts-db
cargo run --bin exo schema create | psql concerts-db
  1. Start the server
EXO_JWT_SECRET="abcd" EXO_POSTGRES_URL=postgresql://localhost:5432/concerts-db EXO_POSTGRES_USER=$USER cargo run --bin exo dev

During development, it is nicer to use cargo watch and let compilation and restart the server automatically with any source changes.

EXO_JWT_SECRET="abcd" EXO_POSTGRES_URL=postgresql://localhost:5432/concerts-db EXO_POSTGRES_USER=$USER cargo watch -cx "run --bin exo dev"

Please see CLI Reference for options such as setting paths for the GraphQL playground and query endpoint.

Logging, tracing, and telemetry

The code is instrumented using the tracing framework and will output log events to the console by default. For more details, including setting logging levels and using OpenTelemetry, see the Exograph telemetry documentation.

About

Build production-ready backends in minutes

https://exograph.dev

License:Other


Languages

Language:Rust 96.3%Language:TypeScript 1.2%Language:JavaScript 1.2%Language:Shell 1.0%Language:Handlebars 0.1%Language:PowerShell 0.1%Language:HTML 0.0%Language:Dockerfile 0.0%Language:CSS 0.0%