Skip to content

Commit ed5ef80

Browse files
committed
remove EntityHandler from codegen for composed subgraphs
1 parent 70423ca commit ed5ef80

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

packages/cli/src/protocols/subgraph/scaffold/mapping.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ export const generatePlaceholderHandlers = ({
77
}) => `
88
import { ExampleEntity } from '../generated/schema'
99
import {${entities.join(', ')}} from '../generated/subgraph-${contract}'
10-
import { EntityTrigger } from '@graphprotocol/graph-ts'
1110
1211
${entities
1312
.map(
1413
entityName => `
15-
export function handle${entityName}(entity: EntityTrigger<${entityName}>): void {
14+
export function handle${entityName}(entity: ${entityName}): void {
1615
// Empty handler for ${entityName}
1716
}`,
1817
)

packages/ts/common/collections.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -457,28 +457,6 @@ export class Entity extends TypedMap<string, Value> {
457457
}
458458
}
459459

460-
/**
461-
* Common representation for entity triggers, this wraps the entity
462-
* and has fields for the operation type and the entity type.
463-
*/
464-
export class EntityTrigger<T extends Entity> {
465-
constructor(
466-
public operation: EntityOp,
467-
public type: string,
468-
public data: T, // T is a specific type that extends Entity
469-
) {}
470-
}
471-
472-
/**
473-
* Enum for entity operations.
474-
* Create, Modify, Remove
475-
*/
476-
export enum EntityOp {
477-
Create,
478-
Modify,
479-
Remove,
480-
}
481-
482460
/**
483461
* The result of an operation, with a corresponding value and error type.
484462
*/

0 commit comments

Comments
 (0)