我想在graphQL中发送对象数组,但是当我发送数组时,收到错误错误请求
createGift(gift, categoryid, url, banner,occasionid) {
let connectQuery='';
for (var i = 0; i < occasionid.length; i++)
{connectQuery+=`{"id":"${occasionid[i]}"}`}
console.log(connectQuery)
return this.apollo.mutate({
mutation : this.mutation,
variables: {
"input": {
"name": `${gift.name}`,
"description": `${gift.description}`,
"imageIcon": `${url}`,
"price": `${gift.price}`,
"category":{
"connect":{"id": `${categoryid}`}
},
"occasions":{
"connect":`[${connectQuery}]`
},
"banners": {
"set": banner}
}
}
});
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.2/angular.min.js"></script>
是否可以发送它?