Create webhooks that trigger on every subgraph entity change
entity.save()
, an update is written to an intermediate db which powers the subgraph API. This update is interpreted by a real-time watcher and set to your webhook handler, with an UPDATE
, INSERT
, or DELETE
operation.
block_range
column which shows it’s valid for each block range. This allows you to distinguish between an entity changing vs a change being rolled-back due to blockchain reorgs.
.save()
is called) in a subgraph entity system is denoted as a new version row being created, with a corresponding update on the last version’s row.
There is an entity with the id: 1
created at block 1. A webhook will fire:
CREATE
or UPDATE
webhook, you can do an upsert
in your database for the id
. The id
always tracks a unique entity. The vid
in the payload denotes the version of the id
, where the highest vid
is the latest version.
--secret "some-secret"
to have control over the secret you can use to identify valid traffic from goldsky.