All details about original Chester here. In this fork, I will change some pieces of code for my job. Seems to be our API team uses another specification of GraphQL (php) 🤷🏻♂️
let client = try QueryBuilder().from("client").with(fields: "cid")
let registrationQuery = try QueryBuilder()
.from("registration")
.with(Argument(key: "name", value: "iPhone 8"))
.with(subQuery: client)
.build()
print(registrationQuery)
{
registration(name: "iPhone 8") {
client {
cid
}
}
}
let accounts = QueryBuilder().from("accounts").on("currency", "value")
let accountsQuery = try QueryBuilder()
.from("list")
.with(Argument(key: "cid", value: 1))
.with(subQuery: accounts)
.build()
print(accountsQuery)
{
list(cid: 1) {
accounts {
... on currency,
... on value
}
}
}
print(registrationQuery.flatQuery)
print(accountsQuery.flatQuery)
{registration(name: "iPhone 8") {client {cid}}}
{list(cid: 1) {accounts {... on currency, ... on value}}}