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

GraphQL API does not support the concept of "direction" and "counterparty" for account-level transactions #1335

Open
n1tranquilla opened this issue Jul 26, 2024 · 2 comments
Labels
Data Database, storage or retrieval of data, JSON, serialization, etc. Enhancement Enhancement to an existing feature GraphQL GraphQL API
Milestone

Comments

@n1tranquilla
Copy link
Collaborator

n1tranquilla commented Jul 26, 2024

This is different from being able to query for either outgoing or incoming:

query accountTxnQuery {
  transactions(query: {to: "B62qrRvo5wngd5WA1dgXkQpCdQMRDndusmjfWXWT1LgsSFFdBS9RCsV", from:"B62qrRvo5wngd5WA1dgXkQpCdQMRDndusmjfWXWT1LgsSFFdBS9RCsV"}) {
    to
    from
  }
}

We need to support the concept of "direction" and "counterparty". Here is a suggestion on how it might be structured:

query accountTxnQuery {
  acccounts(query: {pk: "B62qrRvo5wngd5WA1dgXkQpCdQMRDndusmjfWXWT1LgsSFFdBS9RCsV"}) {
    transactions {
        direction
        counterparty
   }
  }
}

Currently, the UI augments the data by iterating over all the data and checking if the recipient or sender contains the account's public key, to determine direction and counterparty. This requires making additional structs (containing the concept of counterparty and direction) and mapping to them before rending, which does not seem ideal.

This seems like it should be a first-class concept in our indexer as it provides and account-centric perspective on transactions either incoming or outgoing.

@n1tranquilla n1tranquilla added Enhancement Enhancement to an existing feature GraphQL GraphQL API Data Database, storage or retrieval of data, JSON, serialization, etc. labels Jul 26, 2024
@n1tranquilla n1tranquilla added this to the Maintenance milestone Jul 26, 2024
@n1tranquilla n1tranquilla moved this to Wishful in MinaSearch.com Jul 26, 2024
@jhult
Copy link
Member

jhult commented Sep 26, 2024

Vaguely related to Granola-Team/mina-block-explorer#882

@jhult
Copy link
Member

jhult commented Sep 26, 2024

Make GraphQL support booleans for account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Database, storage or retrieval of data, JSON, serialization, etc. Enhancement Enhancement to an existing feature GraphQL GraphQL API
Projects
Status: Wishful
Development

No branches or pull requests

2 participants