Skip to content

GraphQL API on mainnet doesn't work #21038

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

Open
mahnunchik opened this issue Jan 31, 2025 · 9 comments
Open

GraphQL API on mainnet doesn't work #21038

mahnunchik opened this issue Jan 31, 2025 · 9 comments
Assignees
Labels

Comments

@mahnunchik
Copy link

Since yesterday GraphQL API on mainnet doesn't work.

All requests returns error:

BadRequestError: Query request timed out. Limit: 15s
Copy link
Contributor

Thank you for opening this issue, a team member will review it shortly. Until then, please do not interact with any users that claim to be from Sui support and do not click on any links!

@stefan-mysten
Copy link
Contributor

Thanks @mahnunchik. Might be location based issue. On the pacific coast I was able to query the network.
Where are you querying from and do you have a query you're trying?

@stefan-mysten stefan-mysten self-assigned this Jan 31, 2025
@mahnunchik
Copy link
Author

@stefan-mysten It seems it is query related issue:

query transactions($affectedAddress: SuiAddress) {
  transactionBlocks(
    filter: {
      affectedAddress: $affectedAddress
    }
  ) {
    nodes {
      digest,
      sender {
        address
      }
    }
  }
}
{
  "affectedAddress": "0xf6f64fd14e45743c6979806fa5bf4a09bc5ed315f3594c9c8c327b4d3919bb38"
}

@stefan-mysten
Copy link
Contributor

Relayed to the team. As you know, GraphQL RPC is still being worked on, so this kind of things are expected (so don't use it for production just yet). Thanks for letting us know.

@mahnunchik
Copy link
Author

@stefan-mysten

The current RPC API is useless because in order to show a list of transactions it is required to (1) load all outgoing transactions (2) load all incoming transactions (3) merge two lists (4) sort by date

And only after that you can take, for example, the latest 10 transaction

Thus, the ability to filter by affectedAddress is critically needed. Which is currently only provided only by GraphQL API.

@stefan-mysten
Copy link
Contributor

@mahnunchik what you probably need is to build your own custom indexer to index the data you need. The RPC will not always give everything that you want for various reasons.

@wlmyng
Copy link
Contributor

wlmyng commented Jan 31, 2025

@stefan-mysten

The current RPC API is useless because in order to show a list of transactions it is required to (1) load all outgoing transactions (2) load all incoming transactions (3) merge two lists (4) sort by date

And only after that you can take, for example, the latest 10 transaction

Thus, the ability to filter by affectedAddress is critically needed. Which is currently only provided only by GraphQL API.

Hey @mahnunchik - appreciate you trying out graphql! I'm assuming that you need this functionality as a wallet provider. Your understanding is correct, that is the case today with json-rpc. Fortunately, we're in the midst of revamping our indexing framework and subsequently the jsonrpc and graphql services. Once those are stabilized, you'll see that both will support querying transaction blocks by affectedAddress.

In the meantime, as @stefan-mysten mentioned, the graphql services are currently in beta. We're aware of performance degradations and other bugs, but these are lower in priority as we're trying to roll out the revamped indexing and reader frameworks.

@mahnunchik
Copy link
Author

@wlmyng thank you for the clarification

When is the estimated date for stabilization of the indexing framework?

@wlmyng
Copy link
Contributor

wlmyng commented Jan 31, 2025

The current RPC API is useless because in order to show a list of transactions it is required to (1) load all outgoing transactions (2) load all incoming transactions (3) merge two lists (4) sort by date
And only after that you can take, for example, the latest 10 transaction

This is a painpoint that is motivating the revamp. If it makes you feel better, currently, our Sui wallet implements this feature the same way :painlaugh:

On the second point, we rate limit and have strict response limits on our public rpc services to discourage users from building production apps on them - these reader services are meant to help new users familiarize with how they can access data off-chain.

When is the estimated date for stabilization of the indexing framework?

We'll blast an announcement everywhere once this is ready. We're wrapping up on the indexer framework, and the current focus is on read performance. Unfortunately I cannot provide a clearer timeline at this moment.

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

No branches or pull requests

3 participants