【发布时间】:2016-04-29 09:54:07
【问题描述】:
我正在考虑编写一个执行以下操作的 API:
- 向用户提供身份验证令牌的注册和登录用户
- 创建地图(数据示例:
{ name: “Quotes”, attributes: [“quote”, “author"] }) - 创建地图项(数据示例:
{ quote: "...", author: "..." })
我会像这样构建查询:
// return the name and id of all the user's maps
maps(authToken="…") {
name,
id
}
// return all the items of a single map
maps(authToken="…") {
map(name=“Quotes") {
items
}
}
// OR by using the map_id
maps(authToken="…") {
map(id=“…") {
items
}
}
那么,我的问题是,这是正确的还是我需要以不同的方式来构建它?
【问题讨论】:
标签: api authentication graphql