mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-11 06:25:13 +00:00
docs: Add Elixir SDK README with comprehensive API documentation and implement modular architecture with GenServer support
- 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
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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
|
||||
Reference in New Issue
Block a user