37 lines
782 B
Swift
37 lines
782 B
Swift
//
|
|
// AccountCreateRequest.swift
|
|
//
|
|
//
|
|
// Created by Juraldinio on 24.08.2022.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
struct AccountCreateRequest: Encodable {
|
|
|
|
struct Variables: Encodable {
|
|
let username: String
|
|
let pubKey: String
|
|
let deviceId: String
|
|
}
|
|
|
|
// MARK: - GraphQL
|
|
|
|
let variables: Variables
|
|
let operationName = "CreateAccount"
|
|
let query: String = #"""
|
|
mutation CreateAccount($username: String!, $pubKey: String!, $deviceId: String!) {
|
|
createAccount(username: $username, pubKey: $pubKey, deviceId: $deviceId) {
|
|
errors, id
|
|
}
|
|
}
|
|
"""#.trimCompact()
|
|
}
|
|
|
|
struct AccountCreateResponse: GraphQLResponse {
|
|
|
|
static let node = "createAccount"
|
|
|
|
let id: Int
|
|
}
|