-
Notifications
You must be signed in to change notification settings - Fork 148
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
base: main
Are you sure you want to change the base?
Three Source Example #889
Conversation
idalithb
commented
Feb 27, 2025
•
edited
Loading
edited
- 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
Wow @idalithb, I'm so sorry. You are completely right; the |
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
website/src/pages/en/subgraphs/cookbook/subgraph-composition-three-sources.mdx
Outdated
Show resolved
Hide resolved
…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. |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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:
- 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
- A [graph-node](https://github.com/graphprotocol/graph-node) instance running locally | |
- A [Graph Node](https://github.com/graphprotocol/graph-node) instance running locally |
There was a problem hiding this comment.
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.)
### 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. |
There was a problem hiding this comment.
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")
There was a problem hiding this comment.
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/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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?)
There was a problem hiding this 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