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

Three Source Example #889

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Three Source Example #889

wants to merge 12 commits into from

Conversation

idalithb
Copy link
Contributor

@idalithb idalithb commented Feb 27, 2025

  • Please review EN version of page ONLY
  • Adding another example for subgraph comp
  • Did not run any additional script, but page was added to all languages automatically

@benface
Copy link
Contributor

benface commented Feb 27, 2025

Did not run any additional script, but page was added to all languages automatically

Wow @idalithb, I'm so sorry. You are completely right; the fix-pages-structure script (and the fetch-remote-docs one) were set to run every time you run dev, not just build like I thought/expected. That is my fault and I somehow never noticed. I fixed it here. Everything I said here should be true now (well, after you pull from main, so for the next changes you have to make). My sincere apologies! 🙇‍♂️

@idalithb idalithb requested a review from isum February 28, 2025 00:22
@idalithb idalithb marked this pull request as ready for review February 28, 2025 00:23
@idalithb idalithb requested a review from a team as a code owner February 28, 2025 00:23
MichaelMacaulay and others added 9 commits March 3, 2025 09:40
…hree-sources.mdx

Co-authored-by: Benoît Rouleau <benoit.rouleau@icloud.com>
…hree-sources.mdx

Co-authored-by: Benoît Rouleau <benoit.rouleau@icloud.com>
…hree-sources.mdx

Co-authored-by: Benoît Rouleau <benoit.rouleau@icloud.com>
…hree-sources.mdx

Co-authored-by: Benoît Rouleau <benoit.rouleau@icloud.com>
…hree-sources.mdx

Co-authored-by: Benoît Rouleau <benoit.rouleau@icloud.com>
…hree-sources.mdx

Co-authored-by: Benoît Rouleau <benoit.rouleau@icloud.com>
…hree-sources.mdx

Co-authored-by: Benoît Rouleau <benoit.rouleau@icloud.com>
…hree-sources.mdx

Co-authored-by: Benoît Rouleau <benoit.rouleau@icloud.com>

## Overview

Subgraph composition empowers you use one Subgraph as a data source for another, allowing it to consume and respond to entity changes. Instead of fetching on-chain data directly, a Subgraph can listen for updates from another Subgraph and react to changes. This is useful for aggregating data from multiple Subgraphs or triggering actions based on external updates.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is "empowers you use" correct? Should it be "empowers you to use"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I think we use "onchain" instead of "on-chain", but I'm not 100% sure.


To deploy **all** Subgraphs locally, you must have the following:

- A [graph-node](https://github.com/graphprotocol/graph-node) instance running locally
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick, but I feel like if we write it "graph-node" it should be inline code, but if we write it "Graph Node" it should be regular text. What do you think? So I'm proposing either:

Suggested change
- A [graph-node](https://github.com/graphprotocol/graph-node) instance running locally
- A [`graph-node`](https://github.com/graphprotocol/graph-node) instance running locally

or

Suggested change
- A [graph-node](https://github.com/graphprotocol/graph-node) instance running locally
- A [Graph Node](https://github.com/graphprotocol/graph-node) instance running locally

Copy link
Contributor

Choose a reason for hiding this comment

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

(Note that we use "Graph Node" below, on line 34.)

Comment on lines +64 to +71
### Step 3. Define Block Size in Source Subgraph

This third source Subgraph indexes the size of each block.

#### Key Functions

- It imports existing schemas from other Subgraphs and adds a `block` entity with a `size` field representing each block's size.
- It listens to blockchain events related to block sizes (e.g., storage or volume) and processes this data to update the Subgraph's entities accordingly.
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this one doesn't need to be deployed locally? (It doesn't say "To deploy this Subgraph locally, run the same commands as above")

Copy link
Contributor

Choose a reason for hiding this comment

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

Same for the 4th one?

## Additional Resources

- Check out all the code for this example in [this GitHub repo](https://github.com/isum/subgraph-composition-example).
- Add advanced features in your Subgraph. Check out [Subgraph advanced features](/developing/creating/advanced/).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Add advanced features in your Subgraph. Check out [Subgraph advanced features](/developing/creating/advanced/).
- To add advanced features to your Subgraph, check out [Subgraph advanced features](/developing/creating/advanced/).

(or is this too repetitive?)

Copy link
Contributor

@benface benface left a comment

Choose a reason for hiding this comment

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

Left some nitpicks. LGTM

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.

3 participants