【发布时间】:2020-05-11 12:20:55
【问题描述】:
我有一个 Json 对象,想将其转换为 graphql 查询,以便在 graphql api 上发布请求。任何人都可以提供任何指向它的指针,因为我无法继续。
JSON object extracted from the POJO:
{
"customer": {
"idFromSource": "123",
"title": "Mrs",
"dateOfBirth": "1980-11-11"
}
}
graphql query that I need to hit a post request:
{
"query": "mutation {updateCustomer(customer:
{idFromSource: \"123\",
title: \"Mrs\",
dateOfBirth: \"1980-11-11\"})
{idFromSource title dateOfBirth}}"
}
【问题讨论】:
-
@Ash Raf 你可以使用类似github.com/dupski/json-to-graphql-query#readme