Migrate subgraph queries from The Graph to Envio HyperIndex#70
Open
hernandoagf wants to merge 8 commits intodevelopmentfrom
Open
Migrate subgraph queries from The Graph to Envio HyperIndex#70hernandoagf wants to merge 8 commits intodevelopmentfrom
hernandoagf wants to merge 8 commits intodevelopmentfrom
Conversation
Replace all per-chain subgraph URLs with a single Envio HyperIndex endpoint and convert all GraphQL queries to Hasura syntax. Entity IDs are now prefixed with chainId, so all fetch functions strip prefixes where needed. Also removes legacy allLocksSummed (spock indexer), its API endpoint, and the unused ParticipationChart component.
Replace stripChainIdPrefix(entity.id) calls with direct field access using new Envio HyperIndex fields (entity.address / entity.pollId), making the code cleaner and removing unnecessary string manipulation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Envio indexer stores addresses as plain strings with inconsistent casing across chains (checksummed vs lowercase). Using _ilike instead of _eq ensures address filters match regardless of case. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ries Replace _in/_nin with _or/_and using _ilike/_nilike for address fields, and convert Delegate_by_pk lookups to regular queries with _ilike to handle inconsistent address casing across chains in the Envio indexer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
simplify totalDelegated calculation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Migrates all subgraph queries from The Graph to Envio HyperIndex, replacing the previous GraphQL API with Envio's Hasura-based query format.
Key changes:
modules/gql/queries/subgraph/to use Envio's Hasura syntax (_eq,_in,_nin,order_by,limit/offset, etc.){chainId}-(e.g.,1-0xabc...), so queries that filter by ID now prefix addresses accordinglystripChainIdPrefixutility ingqlUtils.tsand then replaces most usages with new Envio plain-address fields (entity.address/entity.pollId) for cleaner codegql.constants.tsto point to Envio HyperIndex endpoints instead of The GraphfetchAllLocksSummed,ParticipationChart,allLocksSummedquery, and the/api/executive/all-locksendpointpollIdfield to theSubgraphPolltypeSteps for testing
/api/delegates/[address]/delegator/[delegatorAddress]/historyreturns correct delegate addresses