项目作者: k4wo

项目描述 :
Conver MySQL schema to GraphQL schema
高级语言: JavaScript
项目地址: git://github.com/k4wo/MySQL-to-GraphQL.git
创建时间: 2018-12-16T18:18:23Z
项目社区:https://github.com/k4wo/MySQL-to-GraphQL

开源协议:

下载


Convert MySQL database schema to GraphQL schema. At this moment MySQL 8 is not supported.

  1. Generate GraphQL schema from MySQL database
  2. Options:
  3. --help Show help [boolean]
  4. --version Show version number [boolean]
  5. --password, -p MySQL password [required]
  6. --database, -d MySQL database [required]
  7. --host, -h MySQL host [default: "localhost"]
  8. --port, -o MySQL port [default: 3306]
  9. --user, -u MySQL user [required]

How to use

  1. ./node index.js \
  2. -u `user name` \
  3. -p `password` \
  4. -d `database name` \
  5. -o `port [optional]` \
  6. -h `hostname [optional]`

Optional parameters can be omitted. They should be used when port or host is other than default.

You can easily save it to a file. Just append at the end of run command >> 'file_name'

Output

Will depend on your DB schema but here is an example:

  1. type Users {
  2. id: Int!
  3. email: String!
  4. firstName: String!
  5. lastName: String!
  6. password: String!
  7. mobilePhone: Int!
  8. insurace: String
  9. isActive: Int
  10. coordinates: Point
  11. }
  12. type Point {
  13. x: Float!
  14. y: Float!
  15. }