mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 02:52:53 +00:00
- Add README.md with installation instructions, architecture overview, and API examples for all SDK modules - Refactor TelecomSDK main module to use modular API clients (SubscribersAPI, UsageAPI, PaymentAPI, RatingPlanAPI, SystemAPI, GraphQLAPI) - Add AuthProvider class with API key and JWT token support (generate_jwt_token, validate_jwt_token methods) - Add HTTPClient base
18 lines
406 B
Elixir
18 lines
406 B
Elixir
defmodule TelecomSDK.GraphQLAPI do
|
|
@moduledoc """
|
|
API for GraphQL queries
|
|
"""
|
|
|
|
defstruct [:client]
|
|
|
|
def new(client) do
|
|
%__MODULE__{client: client}
|
|
end
|
|
|
|
def execute(api, query, variables \\ nil) do
|
|
request = %{query: query}
|
|
request = if variables, do: Map.put(request, :variables, variables), else: request
|
|
TelecomSDK.HTTPClient.post(api.client, "/graphql", request)
|
|
end
|
|
end
|