46 lines
930 B
Swift
46 lines
930 B
Swift
//
|
|
// AccountOrderRequest.swift
|
|
//
|
|
//
|
|
// Created by Juraldinio on 29.08.2022.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
struct AccountOrderRequest: Encodable {
|
|
|
|
struct Variables: Encodable {
|
|
let uid: String
|
|
}
|
|
|
|
// MARK: - GraphQL
|
|
|
|
let variables: Variables
|
|
let operationName = "accountOrder"
|
|
let query: String = #"""
|
|
query accountOrder(
|
|
$uid: String!
|
|
) {
|
|
accountOrder(uid: $uid) { timeout, id, modified, status, created }
|
|
}
|
|
"""#.trimCompact()
|
|
|
|
}
|
|
|
|
|
|
struct AccountOrderResponse: GraphQLResponse {
|
|
|
|
private enum Common: String, CodingKey {
|
|
case order = "accountOrder"
|
|
}
|
|
|
|
static let node = ""
|
|
|
|
let order: WalletOrder
|
|
|
|
init(from decoder: Decoder) throws {
|
|
let container = try decoder.container(keyedBy: Common.self)
|
|
self.order = try container.decode(WalletOrder.self, forKey: .order)
|
|
}
|
|
}
|