Giter Site home page Giter Site logo

apapacy / graphql-dataloader-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from entria/graphql-dataloader-boilerplate

0.0 2.0 0.0 730 KB

Very simple boilerplate using GraphQL and DataLoader

License: MIT License

Dockerfile 0.40% JavaScript 74.92% TypeScript 24.68%

graphql-dataloader-boilerplate's Introduction

GraphQL DataLoader Boilerplate

CircleCI codecov

Boilerplate using GraphQL and DataLoader

⭐ TypeScript ⭐

Check it out TS version of this boilerplate: https://github.com/entria/graphql-dataloader-boilerplate-ts

Blog Posts

Directory Structure

├── /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)
│   │   │── /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

Create-GraphQL

If you want to move faster you should use create-graphql to simplify the creation of a GraphQL Server

Command

Setup

npm install

Note: If you do not have mongodb installed, please install it:

brew install mongodb

Develop

npm run watch

Test

npm test

Or

npm run test:watch

Docker and docker-compose

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

Production

# first compile the code
npm run build

# run graphql compiled server
npm start

Flow

npm run flow

Or

flow

REPL server

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)

Schema

Update your schema

npm run update-schema

Take a look on the Schema

graphql-dataloader-boilerplate's People

Contributors

andreicalazans avatar bastiani avatar eladams avatar fakenickels avatar felippepuhle avatar fuechter avatar italosestilon avatar jcmais avatar jgcmarins avatar lucasbento avatar lucianomlima avatar matheuspiment avatar peril-entria[bot] avatar ronal2do avatar sibelius avatar socksrust avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.