apollo-server-starter

by Preposterous

GitHub Readme.md

Apollo Server starter kit

Utilizes Apollo Server, HapiJS and KnexJS on top of PostgreSQL.

Deploy

To get started

  • $ 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

Other notes