coordinates : [ { divId:"1234", divCor: { divleft:"1223", divtop: "455" }, imgCor: { imgleft:"78895", imgtop: "452"
} }, { divId:"1234", divCor :{ divleft:"1223", divtop: "455", }, imgCor :{ imgleft:"78895", imgtop: "452",
} }
]
我的Ajax请求是
`
var data = "mutation M{publishProduct(coordinates: "+this.state.coordinates+"){_id}}";
console.log("publishProduct: "+JSON.stringify(data));
$.ajax ({
type: "POST",
url: "/",
contentType: "application/graphql",
data: data,
dataType : 'json',
success:(data) => {
`
控制台我保持在上面显示为
publishProduct: "mutation M{publishProduct(coordinates: [object Object],[object Object],[object Object]){ _id}} // Before passing data `
它不经过我所需要的格式。
请帮助我如何传递graphQl请求的对象数组。
2017-06-27
Goutham