Skip to content
Open

0 #1

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .eslintrc

This file was deleted.

1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"tabWidth": 2,
"useTabs":false,
"semi": false,
"trailingComma": "all"
}

14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "启动程序",
"program": "${workspaceFolder}\\src\\index.js"
}
]
}
4 changes: 0 additions & 4 deletions .vscode/settings.json

This file was deleted.

29 changes: 10 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
# node-graphql-mysql-demo
yarn

## Run
yarn dev

Clone this repo, modify your database configuration in `config.json`.
IDE
http://localhost:5000/api/gql/ide

Then insatll dependencies and start our project.
GUI
http://localhost:5000/api/gql/gui

```bash
yarn install
npm start
```
API
http://localhost:5000/api/gql

Then open `http://localhost:3000/graphql` in your browser.

`http://localhost:3000/api` is the API address from which we can fetch data.

## Reference

- [Build a GraphQL server for Node.js, using PostgreSQL/MySQL](https://www.youtube.com/watch?v=DNPVqK_woRQ&list=WL&index=5)

- http://graphql.org/graphql-js/

- http://graphql.org/learn
DOC
http://graphql.cn/
7 changes: 0 additions & 7 deletions config.json

This file was deleted.

38 changes: 18 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "node-graphql-mysql-demo",
"version": "1.0.0",
"description": "node-graphql-mysql-demo",
"main": "index.js",
"main": "src/index.js",
"scripts": {
"lint": "eslint ./src/*.js",
"start": "nodemon ./src/server.js"
"dev": "nodemon src",
"test": "cross-env NODE_ENV=test nodemon src",
"start": "cross-env NODE_ENV=production node src"
},
"repository": {
"type": "git",
Expand All @@ -18,24 +19,21 @@
},
"homepage": "https://github.com/AngusFu/node-graphql-mysql-demo#readme",
"dependencies": {
"body-parser": "^1.17.1",
"express": "^4.15.2",
"express-graphql": "^0.6.4",
"faker": "^4.1.0",
"graphiql": "^0.10.2",
"graphql": "^0.9.6",
"graphql-server-express": "^0.7.2",
"mysql": "^2.13.0",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"sequelize": "^3.30.4"
"body-parser": "latest",
"express": "latest",
"express-graphql": "latest",
"faker": "latest",
"graphiql": "latest",
"graphql": "latest",
"apollo-server-express": "latest",
"mysql2": "latest",
"react": "latest",
"react-dom": "latest",
"sequelize": "latest"
},
"devDependencies": {
"eslint": "^3.15.0",
"eslint-config-airbnb": "latest",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^3.0.2 || ^4.0.0",
"eslint-plugin-react": "^6.9.0",
"nodemon": "^1.11.0"
"cross-env": "latest",
"graphql-voyager": "latest",
"nodemon": "latest"
}
}
64 changes: 0 additions & 64 deletions src/Db.js

This file was deleted.

156 changes: 0 additions & 156 deletions src/Schema.js

This file was deleted.

Loading