GraphQL突变问题
我是GraphQL的新手。我正在学习GraphQL 我的输入如下GraphQL突变问题,graphql,Graphql,我是GraphQL的新手。我正在学习GraphQL 我的输入如下 mutation { createEvent:{eventInput: {title: "A Test", description:"Does this work?", price:9.99, date:"2018-12-06T09:26:30.645Z"} } } { "errors": [ { "message": "Syntax Error: Expected Name, found {
mutation {
createEvent:{eventInput: {title: "A Test", description:"Does this work?", price:9.99, date:"2018-12-06T09:26:30.645Z"}
}
}
{
"errors": [
{
"message": "Syntax Error: Expected Name, found {",
"locations": [
{
"line": 2,
"column": 15
}
]
}
]
}
我得到的错误如下
mutation {
createEvent:{eventInput: {title: "A Test", description:"Does this work?", price:9.99, date:"2018-12-06T09:26:30.645Z"}
}
}
{
"errors": [
{
"message": "Syntax Error: Expected Name, found {",
"locations": [
{
"line": 2,
"column": 15
}
]
}
]
}
我相信你的
createEvent
变异应该返回一个对象类型。对于对象类型,您必须为此变异指定至少一个返回类型字段
应该是:
mutation {
createEvent(eventInput: {
title: "A Test"
description:"Does this work?"
price:9.99
date:"2018-12-06T09:26:30.645Z"
}){
someFieldInTheReturnType
}
}
我相信你的
createEvent
变异应该返回一个对象类型。对于对象类型,您必须为此变异指定至少一个返回类型字段
应该是:
mutation {
createEvent(eventInput: {
title: "A Test"
description:"Does this work?"
price:9.99
date:"2018-12-06T09:26:30.645Z"
}){
someFieldInTheReturnType
}
}
很高兴听到这个消息。如果你接受我的回答并投票支持我,那就更好了:DGlad,我愿意听。如果你接受我的答案并投票支持我,那就更好了:D