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

jscomplete/graphql-in-action: A GraphQL project with a backend component written ...

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

开源软件名称(OpenSource Name):

jscomplete/graphql-in-action

开源软件地址(OpenSource Url):

https://github.com/jscomplete/graphql-in-action

开源编程语言(OpenSource Language):

JavaScript 73.9%

开源软件介绍(OpenSource Introduction):

GraphQL In Action

A GraphQL project with a backend component written with GraphQL-js and Apollo Server and a frontend component written in React. Branch "main" is the starting point for the GraphQL In Action book. Other branches are used to track the progress of updates throughout the book:

  • Branch "5.0" is the starting point (Chapter 5 in the book). This is an alias for the "main" branch.

  • Branch "9.0" has a working version of the React app before using the GraphQL API. This is the point where the GraphQL API is complete (except for subscriptions, which are implemented in Chapter 10)

  • Branch "10.0" has a worknig version of using a GraphQL client with a React app without a client library (like Apollo).

  • Branch "10.10" (aliased as "final") has the same React app after converting all data communications to use Apollo Client, adding subscriptions operations, and doing the entire local app state management with Apollo.

Install dependencies

npm install

Start databases

You’ll need Docker Compose (which is part of Docker Desktop).

Then run:

npm run start-dbs

This will download and start a PostgreSQL database container on port 5432 and a MongoDB container on port 27017. Both databases have some sample development data loaded in. The connection credentials for these databases are:

PG_CONNECTION_STRING  = "postgres://postgres:password@localhost:5432/azdev"
MDB_CONNECTION_STRING = "mongodb://localhost:27017/azdev"

If you already have a PostgreSQL database that you would like to use instead of the provided Docker containers, you will need to create the database schemas for the project using the dev-db/schema.* files (which will also load the sample data).

Using psql:

psql -d "postgres://postgres:password@localhost:5432" -c "create database azdev"
psql -d "postgres://postgres:password@localhost:5432/azdev" < dev-dbs/schema.sql

Using mongo:

mongo mongodb://127.0.0.1:27017/ < dev-dbs/schema.mongo

Run for dev

In 2 different terminals:

npm run api-server
npm run web-server

Defaults:




鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
ziprandom/graphql-crystal: a graphql implementation for crystal发布时间:2022-07-10
下一篇:
trevorblades/countries: 发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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