A server boilerplate for using graphql with postgres and apolloclient
- In 'configure/development.js', change schema name from 'boilerplate' to desired postgres schema name.
- If using different postgres credentials, change host, user, and password from 'localhost', 'postgres', and 'root' to appropriate postgres credentials.
- Update postgres schema tables in 'migrations/createPostgresSchema.js'.
- Import seeds as arrays of objects in 'seeds/configureSeeds.js'.
- Inside promise.all, map through array, change 'boilerplate.users' to desired postgres schema and table. ex. 'my_app.items'.
- Change or add datasources inside 'datasources/'. Replace 'datasources/placeholderApi.js' and 'datasources/placeholderDatabase' as appropriate.
- Add datasources to context inside 'datasources/datasources.js'.
- Change or add resolvers inside 'resolvers/'.
- Add resolvers to context inside of 'resolvers/resolvers.js' using the spread operator.
- Change or add graphql schemas inside of 'graphqlSchema/'.
- Query and Mutation types must be extended.
- Add Schema modules to context inside 'graphqlSchema/typeDefs.js' by placing inside the array.
- In 'utils/authentication/configureAuth.js', change cookieName and cookieSigniture as appropriate
- Create and set cookies using the functions in 'utils/authentication/setCookie.js'.
- The second argument the createCookie is the number of hours you want the cookie to last.