Skip to content

graphql: expose all sync progress fields in schema#34112

Open
0xWeakSheep wants to merge 1 commit intoethereum:masterfrom
0xWeakSheep:fix/graphql-syncstate-schema
Open

graphql: expose all sync progress fields in schema#34112
0xWeakSheep wants to merge 1 commit intoethereum:masterfrom
0xWeakSheep:fix/graphql-syncstate-schema

Conversation

@0xWeakSheep
Copy link
Copy Markdown

Summary

This PR fixes a schema/resolver mismatch for GraphQL SyncState.

graphql.SyncState resolver already exposes the full sync progress surface, but graphql/schema.go only declared:

  • startingBlock
  • currentBlock
  • highestBlock

As a result, several implemented sync progress fields were not queryable through GraphQL.

This change adds the missing fields to the GraphQL schema:

  • syncedAccounts
  • syncedAccountBytes
  • syncedBytecodes
  • syncedBytecodeBytes
  • syncedStorage
  • syncedStorageBytes
  • healedTrienodes
  • healedTrienodeBytes
  • healedBytecodes
  • healedBytecodeBytes
  • healingTrienodes
  • healingBytecode
  • txIndexFinishedBlocks
  • txIndexRemainingBlocks
  • stateIndexRemaining

Tests

Added TestSyncStateSchemaFields in graphql/graphql_test.go.

The test runs a GraphQL introspection query on SyncState and asserts all expected field names are present, preventing future schema drift.

Why

Without these schema entries, clients cannot access resolver fields that are already implemented and documented by the syncing resolver comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant