尝试在图形查询上发布帖子,但无法正确查询。
请求:
"{query":inventoryPositions(productRef:"SKU_3"){edges{node{onHand quantities{edges{node{ref quantity type}}}}}}}")
响应:
{
"errors": [
{
"code": "400",
"message": "Could not read document: Unexpected character ('q' (code 113)): was expecting double-quote to start field namen
}
]
}
我也试过这个,但没有工作:
{"query":"{inventoryPositions(productRef:"SKU_3"){edges{node{onHand quantities{edges{node{ref quantity type}}}}}}}"}
请帮忙。
基本上它需要 2 个转义,例如,无论您在哪里发布变量
"{" + "\"query\": \"{inventoryPosition(productRef: \\"SKU_3\\" locationRef: \\"locRef1\\"({edges{node{onHand quantities{edges{node{ref quantity type}}}\"" + "}">
为我工作