【文件属性】:
文件名称:nodejs-graphql:具有Nodejs Express和MongoDB的基本Graphql服务器
文件大小:7KB
文件格式:ZIP
更新时间:2021-02-20 01:46:19
JavaScript
nodejs-graphql
带有Nodejs Express和MongoDB的基本Graphql服务器
Hashnode文章-
如何运行项目
将Example.env重命名为.env以获取环境变量
运行npm install安装项目依赖项
运行npm start启动服务器
添加记录:作者
mutation {
addAuthor(name: "Chinua Achebe", age: 85) {
name,
age
}
}
查询记录:作者
{
authors {
id,
name,
book { name, pages }
}
}
添加记录:书
mutation{
addBook(name: "Lukong and the Leopard", pages: 114, authorID: 02f386531a8e02341ab45
【文件预览】:
nodejs-graphql-main
----src()
--------models()
--------app.js(2KB)
--------config()
--------index.js(87B)
--------schema()
----example.env(122B)
----README.md(2KB)
----.gitignore(45B)
----package.json(865B)