我有这个 GraphQL:
mutation MyMutation($dayPhone: String!, $email: String!, $firstName: String!, $noOfDoors: String!, $noOfFrenchPatio: String!, $noOfWindows: String!, $postcode: String!, $quotationDate: DateTime!, $quotationId: String!, $refCode: String!, $surname: String!, $slug: String!, $authorId: ID!) {
save_quotes_quotation_Entry(
dayPhone: $dayPhone
email: $email
firstName: $firstName
noOfDoors: $noOfDoors
noOfFrenchPatio: $noOfFrenchPatio
noOfWindows: $noOfWindows
postcode: $postcode
quotationDate: $quotationDate
quotationId: $quotationId
refCode: $refCode
surname: $surname
slug: $slug
authorId: $authorId
) {
id
}
}
当在我的 Craft CMS 内的 GraphQL 资源管理器中执行时,它完美运行,创建了一个引用条目,当从我的 nuxt3 前端执行时,我收到以下错误:
{
"errors": [
{
"message": "Cannot query field \"save_quotes_quotation_Entry\" on type \"Mutation\".",
"extensions": {
"category": "graphql"
},
"locations": [
{
"line": 16,
"column": 3
}
]
}
]
}
为什么会这样,两者都使用完全相同的语法。