• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

entria/graphql-dataloader-boilerplate: Very simple boilerplate using GraphQL and ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

entria/graphql-dataloader-boilerplate

开源软件地址(OpenSource Url):

https://github.com/entria/graphql-dataloader-boilerplate

开源编程语言(OpenSource Language):

JavaScript 74.9%

开源软件介绍(OpenSource Introduction):

Deprecated

Try a better version here https://github.com/entria/entria-fullstack

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

yarn install

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

brew install mongodb

Develop

yarn watch

Test

yarn test

Or

yarn 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
yarn build

# run graphql compiled server
yarn start

Flow

yarn flow

Or

flow

REPL server

yarn 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

yarn update-schema

Take a look on the Schema




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap