Files
telecom-platform/sdk/swift/Sources/TelecomSDK/GraphQLAPI.swift
T
2026-05-03 13:44:09 +03:00

17 lines
478 B
Swift

import Foundation
/// API for GraphQL queries
public class GraphQLAPI {
private let client: HTTPClient
public init(client: HTTPClient) {
self.client = client
}
/// Execute a GraphQL query
public func execute(query: String, variables: [String: Any]? = nil) async throws -> [String: Any] {
let request = GraphQLRequest(query: query, variables: variables)
return try await client.post(path: "/graphql", body: request)
}
}