Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 1.11 KB

File metadata and controls

30 lines (22 loc) · 1.11 KB

This repo is a work in progress example of making complex api with diesel, juniper, actix, juniper-from-schema and juniper-eager-loading (needed to solve N+1 issues and this lib work with juniper-from-schema).
The goal is also to find where we can ease some process between diesel and juniper (matching types...).
I am pretty new to rust so I encourage everybody to check this code and sugest improvements !

Init

Just run diesel database setup --database-url postgres://postgres:postgres@localhost/graphqlapi

Run

docker-compose up -d
cargo run

Schemes

Database

Database scheme

Observations

  • When using enum we need to implement lot of code to be able to store it into diesel (create new enum, impl From for the diesel enum and for the graphql enum) -> see this file

TODO

  • Add tests
  • Add metrics route (prometheus for exemple)
  • Add health route (for kube check health)
  • Create public and private api with differents ports but sharing database, metrics...
  • Add Dockerfile