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

add a note on setting object references via context #543

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions website/pages/en/developing/creating-a-subgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,8 @@ let tradingPair = context.getString('tradingPair')

There are setters and getters like `setString` and `getString` for all value types.

> **Note:** Referecing an entity is done via ID in graphQL. That id can be passed into the instantiated data source by setting it in the context and then accessed within the mapping of the template. Example can be found in the [documenation of graph-ts](https://github.com/graphprotocol/graph-tooling/tree/main/packages/ts#api).

## Start Blocks

The `startBlock` is an optional setting that allows you to define from which block in the chain the data source will start indexing. Setting the start block allows the data source to skip potentially millions of blocks that are irrelevant. Typically, a subgraph developer will set `startBlock` to the block in which the smart contract of the data source was created.
Expand Down