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

feat: support querying block data in transaction schema #132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

luciorubeens
Copy link
Member

This PR improves the transaction model by introducing a block resolver, allowing transactions to be queried along with their associated block data. This is useful for retrieving details like the block timestamp without requiring separate queries.

Usage example:

query {
  getTransactions(
    where: {
      hash: { eq: "u/KxH6JkCktJARpBn5nrYHJs91cLSREqZLKJUbgYFf8=" }
    }
  ) {
    hash
    block_height
    block {
      time
    }
  }
}

@ajnavarro
Copy link
Collaborator

ajnavarro commented Feb 25, 2025

Seems reasonable.

WDYT about deprecating block_height on the Transactions model? to keep the API consistent. It can still be used internally for doing the Block query, but I would rather not expose it and if the user needs the data, they can get it through the block object if required.

Should we do the same when retrieving blocks? WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

2 participants