graphql 数据导入工具

graphql 是比 比较方便的工具,但是数据导入也是一个比较重要的工具类似prisma
包含一个seed 的功能,类似docker我们使用mysql 数据库的initdb.d,但是那个基本上就
是添加在初始化的时候执行mutation 操作,一般数据是有限的,而且不是很方便(一般够用了)
graphql-cli-load 可以方便的进行批量数据的导入,详细使用可以参考github资料

工具选项

/usr/local/bin/graphql load [--json] [--csv] [--endpoint] [--mutation] [--mapping] [--delim]

Optionen:
  --help Hilfe anzeigen [boolean]
  --mapping, -p name mapping of input to mutation (json)
  --mutation, -m mutation to call
  --endpoint, -e endpoint name to use
  --json, -j json file to load
  --csv, -c csv file to load
  --delim, -d delimiter for arrays  

说明

这个工具对于使用模型原先,以及需要自定编写schema 的比较方便,但是类似那个数据优先的就没有必要的,直接
导入数据到数据库就可以了

参考资料

https://github.com/neo4j-graphql/graphql-cli-load

猜你喜欢

转载自www.cnblogs.com/rongfengliang/p/9625711.html