运行Apollo CLI命令“ apollo client:check --key =“ MyAPIKEYXX” --includes =“ ./ src / ** / *。js”
✅Loading Apollo Project
✅Checking client: compatibility with service
我收到此错误:
Cannot query field "CreateBook" on type Mutation
Cannot query field "Books" on type Query
2 operations validated
2 failures
知道我在做什么错吗?
client.query(
{
query: gql`
query Books{
books {
title
author
}
}
`,
})
.then((result) => console.log(result));
client.mutate(
{
mutation: gql`
mutation CreatBook{
createBook(input:
{ title: "World"
author: "De la ve"}){
id
title
author
}
}
`
}
)
答案 0 :(得分:0)
我发现了问题,我的类型查询和类型突变在后端没有正确的数据类型...。