mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-08 00:44:06 +00:00
Update subgraph watcher demo readme (#480)
* Update subgraph watcher demo readme * Pass extra block data required in subgraph block handler (#486) * Use codegen config directory name instead of file path * Get block data from extra event data * Add extra event data in processBlockAfterEvents --------- Co-authored-by: neeraj <neeraj.rtly@gmail.com> * Update example subgraph mapping code for graph-cli upgrade * Return 0 value for block size in ipld-eth-client --------- Co-authored-by: neeraj <neeraj.rtly@gmail.com> Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
@@ -50,6 +50,7 @@ export function handleTest (event: Test): void {
|
||||
if (!category) {
|
||||
category = new Category(author.blogCount.toString());
|
||||
category.name = event.params.param1;
|
||||
category.count = BigInt.zero();
|
||||
}
|
||||
|
||||
category.count = category.count + BigInt.fromString('1');
|
||||
@@ -59,13 +60,14 @@ export function handleTest (event: Test): void {
|
||||
blog.kind = 'long';
|
||||
blog.isActive = true;
|
||||
|
||||
const blogReviews = blog.reviews;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
const blogReviews: BigInt[] = new Array(0);
|
||||
blogReviews.push(BigInt.fromString('4'));
|
||||
blog.reviews = blogReviews;
|
||||
|
||||
blog.author = author.id;
|
||||
|
||||
const categories = blog.categories;
|
||||
const categories: string[] = new Array(0);
|
||||
categories.push(category.id);
|
||||
blog.categories = categories;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user