Skip to content

Latest commit

 

History

History
122 lines (122 loc) · 3.66 KB

gql-README.md

File metadata and controls

122 lines (122 loc) · 3.66 KB

GraphQL Wallet API Endpoint

This GraphQL API provides operations to manage Wallets and Wallet Transactions.

Getting Started

Prerequisites

To use this API, you need to have:

  • A GraphQL client to make queries and mutations to this API (e.g., Apollo)
  • The URL of the GraphQL endpoint

Available Operations

The following operations are available in this API:

Queries

  • getAllWalletTransaction(walletId: String!, skip: Int!, limit: Int!): Returns a list of wallet transactions for the specified wallet ID, with optional pagination.
  • getWallet(walletId: String!): Returns the wallet with the specified ID.

Mutations

  • createWallet(createWalletInput: WalletInput!): Creates a new wallet with the specified name and optional balance.
  • updateWallet(updateWalletInput: UpdateWalletInput!): Updates the wallet with the specified ID, with optional name and balance.
  • removeWallet(id: Int!): Removes the wallet with the specified ID.
  • setupWallet(setupWalletInput: WalletInput!): Creates or updates a wallet with the specified name and balance.
  • transactWallet(transactWalletInput: walletTransactionInput!): Creates a new transaction for the specified wallet ID with the specified description, amount, and type (credit or debit).

Types

  • WalletOutput: The output type for wallets, containing the wallet's balance, name, and ID.
  • walletTransactionOutput: The output type for wallet transactions, containing the transaction's description, wallet ID, amount, type, ID, transaction ID, and balance.
  • WALLET_TX_TYPE: The enumeration for wallet transaction types, with options for credit and debit.
  • WalletInput: The input type for creating a new wallet or updating a wallet's name and balance.
  • UpdateWalletInput: The input type for updating a wallet's name and balance.
  • walletTransactionInput: The input type for creating a new wallet transaction with the specified description, amount, and type (credit or debit).

Example Usage

To get all wallets:

query { getWallet(walletId: "provide_wallet_id") { balance name id } }

To create a new wallet:

mutation { createWallet(createWalletInput: {name: "New Wallet", balance: 100}) { balance name id } }

Built With