mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-30 00:22:15 +00:00
@@ -0,0 +1,16 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user