Skip to content

Commit 2a247e6

Browse files
authored
fix: middleware manifest and mappings (#481)
## Summary by Sourcery Update the Graph middleware guide to use the correct data source list format in the manifest and fix sample code import paths to point to the right generated folder. Bug Fixes: - Update sample code imports to reference the correct "generated/generated" directory for schema and API files. Enhancements: - Convert the manifest YAML to a list-based dataSources format with proper indentation and dash prefixes.
1 parent 13908b8 commit 2a247e6

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

content/docs/building-with-settlemint/evm-chains-guide/setup-graph-middleware.mdx

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -173,33 +173,33 @@ contract (parameter order and types must be accurate), and align them with the
173173
corresponding handler function names.
174174

175175
```yaml
176-
- kind: ethereum/contract
177-
name: { id }
178-
network: { chain }
179-
source:
180-
address: "{address}"
181-
abi: UserData
182-
startBlock: { startBlock }
183-
mapping:
184-
kind: ethereum/events
185-
apiVersion: 0.0.5
186-
language: wasm/assemblyscript
187-
entities:
188-
- UserProfile
189-
- ProfileCreated
190-
- ProfileUpdated
191-
- ProfileDeleted
192-
abis:
193-
- name: UserData
194-
file: "{root}/out/UserData.sol/UserData.json"
195-
eventHandlers:
196-
- event: ProfileCreated(indexed uint256,string,string,uint8,string,bool)
197-
handler: handleProfileCreated
198-
- event: ProfileUpdated(indexed uint256,string,string,uint8,string,bool)
199-
handler: handleProfileUpdated
200-
- event: ProfileDeleted(indexed uint256)
201-
handler: handleProfileDeleted
202-
file: { file }
176+
- kind: ethereum/contract
177+
name: {id}
178+
network: {chain}
179+
source:
180+
address: "{address}"
181+
abi: UserData
182+
startBlock: {startBlock}
183+
mapping:
184+
kind: ethereum/events
185+
apiVersion: 0.0.5
186+
language: wasm/assemblyscript
187+
entities:
188+
- UserProfile
189+
- ProfileCreated
190+
- ProfileUpdated
191+
- ProfileDeleted
192+
abis:
193+
- name: UserData
194+
file: "{root}/out/UserData.sol/UserData.json"
195+
eventHandlers:
196+
- event: ProfileCreated(indexed uint256,string,string,uint8,string,bool)
197+
handler: handleProfileCreated
198+
- event: ProfileUpdated(indexed uint256,string,string,uint8,string,bool)
199+
handler: handleProfileUpdated
200+
- event: ProfileDeleted(indexed uint256)
201+
handler: handleProfileDeleted
202+
file: {file}
203203
```
204204
205205
### 4. Create userdata.gql.json file
@@ -290,13 +290,13 @@ import {
290290
ProfileCreated as ProfileCreatedEvent,
291291
ProfileUpdated as ProfileUpdatedEvent,
292292
ProfileDeleted as ProfileDeletedEvent,
293-
} from "../../generated/userdata/UserData";
293+
} from "../../generated/generated/userdata/UserData";
294294
import {
295295
UserProfile,
296296
ProfileCreated,
297297
ProfileUpdated,
298298
ProfileDeleted,
299-
} from "../../generated/schema";
299+
} from "../../generated/generated/schema";
300300
import { fetchUserProfile } from "../fetch/userdata";
301301

302302
export function handleProfileCreated(event: ProfileCreatedEvent): void {
@@ -372,7 +372,7 @@ initialized value to prevent errors during Graph Node processing.
372372

373373
```ts
374374
import { BigInt } from "@graphprotocol/graph-ts";
375-
import { UserProfile } from "../../generated/schema";
375+
import { UserProfile } from "../../generated/generated/schema";
376376

377377
/**
378378
* Fetches a UserProfile entity using the given userId.

0 commit comments

Comments
 (0)