This is an example graphql backend for a fitness app, to be used together with https://github.com/skeie/rn-show-case. The app has limited seed data, so you'd have to add this yourself.
- Download & Install Dependencies
-
# Install dependencies $ yarn $ createdb node_showcase && createdb node_showcase_test $ yarn run migrate:up $ yarn run migrate:up:test
$ yarn start $ open http://localhost:3000/graphql
yarn run test:unit
yarn run test:integration
# update snapshots
SNAPSHOT_UPDATE=1 yarn run test:integration
create migration:
yarn run migrate create <name> --sql-file
Sometimes we change current migrations instead of adding new ones. In that case:
yarn resetdb
This is where we have our graphql schema types layed out. We also define entry points for the query resolvers and mutations
This is where we put our query resolvers. It should use StoreDataSources to manipulate the database, and DataSources to call external services
This is where we put our mutations. It should use StoreDataSources to manipulate the database, and DataSources to call external services
This is where we manipulate the database
This is where we call external services
This is where we serialize data from the StoreDataSources