Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve token service graphql queries #713

Merged
merged 9 commits into from
May 22, 2024
Merged

Improve token service graphql queries #713

merged 9 commits into from
May 22, 2024

Conversation

James-Mart
Copy link
Member

@James-Mart James-Mart commented May 20, 2024

This adds a new capability to graphql queries in C++: A vector of objects dynamically constructed at query time can be more easily queried using graphql.

The tokens query service uses this to allow for pagination on a dynamically constructed vector of objects, rather than returning the entire vector.


New queries:

  1. userBalances(AccountNumber user, ...pagination)
  2. userCredits(AccountNumber user, ...pagination)
  3. userDebits(AccountNumber user, ...pagination)
  4. tokenDetails(TID tokenId)

The first three queries manually construct an index that combines the normal balance table row with details about the token (symbolID and precision) in order to return all relevant details within a single query.

The fourth new query tokenDetails returns details about a token given its ID, including the current owner of the issuer NFT, and the auth-service set by that owner account.

@James-Mart James-Mart requested a review from swatanabe May 20, 2024 18:41
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Showed up on build

@James-Mart James-Mart added the System app Related to system services and their apps/plugins label May 20, 2024
services/user/Tokens/src/RTokens.cpp Outdated Show resolved Hide resolved
services/user/Tokens/src/RTokens.cpp Outdated Show resolved Hide resolved
services/user/Tokens/src/RTokens.cpp Show resolved Hide resolved
services/user/Tokens/include/services/user/tokenTables.hpp Outdated Show resolved Hide resolved
@James-Mart James-Mart merged commit befe75c into main May 22, 2024
4 checks passed
@James-Mart James-Mart deleted the add-token-query branch May 22, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
System app Related to system services and their apps/plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants