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

Refactor query implementation for the Graph's service migration #123

Merged

Conversation

evandrosaturnino
Copy link
Contributor

Description

Refactor the querying implementation in response to The Graph's recent transition from the hosted-service to the Studio service.

Key changes include:

Updated query format to be compatible with The Graph Studio services.
Introduced requirements for a subgraph ID and a subgraph API key secret to authenticate queries.

These changes are necessary to maintain our application's connectivity with The Graph's services and ensure seamless data querying.

Notice

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Pull Request Type

  • New Feature (Breaking/Non-breaking Change)

Fixes #121

Testing

Please outline all testing steps

  1. Clone the repo - git clone https://github.com/threshold-network/website.git
  2. Install dependencies - yarn install
  3. Build the app - yarn build
  4. Run the app - yarn start

Copy link

github-actions bot commented Jul 2, 2024


export const TBTC_SUBGRAPH_ID = "DETCX5Xm6tJfctRcZAxhQB9q3aK8P4BXLbujHmzEBXYV"

export const SUBGRAPH_GATEWAY_URL = `https://gateway-arbitrum.network.thegraph.com/api/${process.env.SUBGRAPH_API_KEY}/subgraphs/id/`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering why the subgraph gateway is gateway-arbitrum when tbtc is on mainnet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Graph processes Layer 1 (L1) data on Arbitrum to reduce costs, enhance scalability, and improve efficiency. This enables faster querying and processing of subgraphs, making the entire curation process more cost-effective.

For more information, please refer to: https://thegraph.com/docs/en/arbitrum/l2-transfer-tools-guide/

Copy link
Contributor

@michalsmiarowski michalsmiarowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks ok. Have to test it with subgraph api key though, which I don't have yet. I will probably continue this review tomorrow (unless I will have the key earlier 😛 )

src/hooks/useQuery.ts Outdated Show resolved Hide resolved
src/hooks/useQuery.ts Outdated Show resolved Hide resolved
src/templates/home-page/Hero/index.tsx Outdated Show resolved Hide resolved
src/config/subgraph.ts Show resolved Hide resolved
Only tbtc graph was not working so we don't need to replace the graph for t
network. Replacing it the staking tvl section to show a wrong value.
Copy link

github-actions bot commented Jul 5, 2024

Copy link
Contributor

@michalsmiarowski michalsmiarowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🔥

@michalsmiarowski michalsmiarowski merged commit 9214f5c into main Jul 5, 2024
3 checks passed
@michalsmiarowski michalsmiarowski deleted the update-subgraph-service-querying-implementation branch July 5, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Link to TACo Page
4 participants