Boilerplate using GraphQL and DataLoader
- How to implement viewerCanSee in GraphQL
- Testing a GraphQL Server using Jest
- Parallel testing a GraphQL Server with Jest
- Encapsulating data on GraphQL using Loaders
├── /data/ # GraphQL generated schema
├── /repl/ # Read-Eval-Print-Loop (REPL) configuration
├── /scripts/ # Generate GraphQL schema script
├── /src/ # Source code of GraphQL Server
│ ├── /core/ # Core types and helper files, can be used like a global module
│ ├── /interface/ # NodeInterface (Relay) and other GraphQL Interfaces
│ ├── /modules/ # Modules (think on modules like isolated pieces of your code)
│ ├── /modules/ # Modules (think on modules like isolated pieces of your code)
│ │ │── /mutation/ # Module mutations (add an index file to be used on MutationType)
│ │ │── /subscription/ # Module subscriptions (add an index file to be used on SubscriptionType)
│ │ │── /enum/ # Enums related to this module
├── /test/ # Test helpers
If you want to move faster you should use create-graphql to simplify the creation of a GraphQL Server
npm install
Note: If you do not have mongodb installed, please install it:
brew install mongodb
npm run watch
npm test
Or
npm run test:watch
No needs for installing dependencies or running mongod
in another terminal window
docker-compose build && docker-compose up
Test
docker-compose -f docker-compose.test.yml build && docker-compose -f docker-compose.test.yml up
# first compile the code
npm run build
# run graphql compiled server
npm start
npm run flow
Or
flow
npm run repl
awesome > const user = await M.User.find()
Yep, await syntax works on the repl, it is awesome, tks @princejwesley (https://gist.github.com/princejwesley/a66d514d86ea174270210561c44b71ba)
Update your schema
npm run update-schema
Take a look on the Schema