Utilizes Apollo Server, HapiJS and KnexJS on top of PostgreSQL.
$ yarn global add knex
/$ npm install -g knex
$ createdb apollo_server && psql -d apollo_server -f bootstrap.sql
$ knex migrate:latest
$ knex seed:run
$ yarn dev
/$ npm run dev
http://localhost:3000/graphiql
- Try the following query:
{ Guest(email: "johnsmith@gmail.com") { firstName lastName reservations { arrivalDate departureDate guests } } }
- Try the following mutation:
mutation { createGuest(input: { firstName: "Jane" lastName: "Doe" email: "janedoe@gmail.com" }) { id } }
- Next steps: Try creating a mutation to create a reservation for a given guest
- View documentation generated with Graphdoc at
http://localhost:3000/doc
- Project also includes an example of a custom scalar.