graphql-mongodb-boilerplate

Crates.iographql-mongodb-boilerplate
lib.rsgraphql-mongodb-boilerplate
version0.3.1
sourcesrc
created_at2020-01-19 23:09:54.200496
updated_at2020-05-02 22:15:44.406325
descriptionA simple Rust graphql service boilerplate using actix, mongodb and juniper
homepage
repositoryhttps://github.com/briandeboer/graphql-mongodb-boilerplate
max_upload_size
id200286
size87,702
Brian DeBoer (briandeboer)

documentation

README

Rust graphql service boilerplate

This provides a simple graphql boilerplate for services. It uses:

Just change/add to the models, services and the graphql_schema accorindgly.

Usage

Seed some data with...

cargo run --bin seed

Run the server with...

cargo run

And then test at:

http://localhost:8080/graphiql

Sample query for pets

{
  allPets(limit:4){
    pageInfo{
      startCursor
      nextCursor
      hasPreviousPage
      hasNextPage
    }
    pets{
      name
      id
      age
      petType
      gender
      owner{
        id
        username
      }
    }
    totalCount
  }
}

Sample query for owners

{
  allOwners {
    pageInfo {
      startCursor
      nextCursor
    }
    owners {
      id
      firstName
      lastName
      pets {
        id
        name
      }
    }
  }
}

Inspiration and some resources to help

Commit count: 10

cargo fmt