Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Expand on Accounts schema in GraphQL #1831

Closed
buffalojoec opened this issue Nov 11, 2023 · 2 comments · Fixed by #2068
Closed

Expand on Accounts schema in GraphQL #1831

buffalojoec opened this issue Nov 11, 2023 · 2 comments · Fixed by #2068
Labels
enhancement New feature or request GraphQL

Comments

@buffalojoec
Copy link
Contributor

Making this issue to track discussions on the new Accounts schema in GraphQL.

The revised Account schema should (potentially) make use of interfaces in the following manner - as discussed in this comment:

query {
  account(address: "abc") {
    # Stuff that every account has...
    address
    owner
    space
    ... on MintAccount {
      decimals
      isInitialized
      mintAuthority
      supply
    }
  }
}

In doing so, we'll need to ensure field names don't collide. This means, for example, changing owner to ownerProgram in the root Account type.

Developers also shouldn't need to do spread syntax on nested account queries, but this will require careful consideration of encoded nested account data (base58, etc.). See this comment for more context.

@buffalojoec buffalojoec added enhancement New feature or request GraphQL labels Nov 11, 2023
@buffalojoec
Copy link
Contributor Author

Note, this PR continues talks from #1817, since schema modifications will be much easier to follow after #1819

buffalojoec added a commit that referenced this issue Nov 28, 2023
This PR attempts to revise the accounts schema, as per #1831.
buffalojoec added a commit that referenced this issue Feb 22, 2024
This commit re-works the schema to deal with `encoding` and `dataSlice` directly
on the `data` field, rather than an `account` query at the top-level.

With this particular commit, the number of RPC calls to resolve a wide range of
queries is likely increased - such as multiple `data` fields on `programAccounts`.
However, the subsequent commits in this stack will seek to remedy this.

Specifically, the next commit introduces better account resolvers, which may
lessen the RPC calls for `account` queries by way of cache hits, but the commit
after that will introduce the revamped batch loader, which provides significant
optimizations to the number and timing of RPC calls.

Further up the stack are more changes to ensure the other queries, like
`programAccounts`, get to share in the benefits of similar optimizations.

Closes #1831
Copy link
Contributor

github-actions bot commented Mar 1, 2024

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request GraphQL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant