【发布时间】:2020-03-09 12:44:13
【问题描述】:
我尝试在 Strapi 项目中使用 GraphQL 模块。我想添加新的查询。你可以看看我的代码:
{
"routes": [
{
"method": "GET",
"path": "/recipes",
"handler": "Recipes.recipes"
}
]
}
还有我的架构:
module.exports = {
definition: `
type Recipe {
title: String!
}
`,
query: `
recipes: Recipe
`,
resolver: {
Query: {
recipes: {
description: 'Return a single Recipe',
resolver: 'Recipes.recipes'
}
}
}
};
我的查询返回错误 403。但是,如果我使用 CURL 命令尝试我的 URL,我得到了正确的响应。
谁知道我是否需要为没有策略的 GraphQL 查询添加其他参数?
谢谢!
【问题讨论】: