我有这个工作正常的简单突变
type Mutation {
addJob(
url: String!
description: String!
position: String!
company: String!
date: DateTime!
tags: [String!]!
): Job
}
突变解析器
function addJob(parent, args, context, info) {
console.log('Tags => ', args.tags)
// const userId = getUserId(context)
return context.db.mutation.createJob(
{
data: {
position: args.position,
componay: args.company,
date: args.date,
url: args.url,
description: args.description,
tags: args.tags
}
},
info
)
}
但是,一旦我尝试将字符串(标签)数组放在上面
Error: Variable "$_v0_data" got invalid value { ... , tags: ["devops", "aws"] }; Field "0" is not defined by type JobCreatetagsInput at value.tags.
如果我为突变中的标签分配了一个空数组,则没有问题,但是如果我输入一个字符串值 ["DevOps"] 例如我得到错误