Skip to content

Commit e3c3ae9

Browse files
committed
fix: correct TypeScript import paths and DataLoader types
- Fix import paths for AllocationDecision from ../subgraphs - Fix import paths for SubgraphDeployment from ../types - Fix parser imports from ../indexer-management/types - Handle DataLoader loadMany() Error types properly 🤖 Generated with Claude Code (claude.ai/code)
1 parent f8be8e5 commit e3c3ae9

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

packages/indexer-common/src/performance/allocation-priority-queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Logger } from '@graphprotocol/common-ts'
2-
import { AllocationDecision } from '../allocations'
2+
import { AllocationDecision } from '../subgraphs'
33
import { BigNumber } from 'ethers'
44

55
export interface PriorityItem<T> {

packages/indexer-common/src/performance/concurrent-reconciler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Logger, SubgraphDeploymentID } from '@graphprotocol/common-ts'
2-
import { AllocationDecision, Allocation } from '../allocations'
2+
import { Allocation } from '../allocations'
3+
import { AllocationDecision } from '../subgraphs'
34
import { Network } from '../network'
45
import { Operator } from '../operator'
56
import pMap from 'p-map'

packages/indexer-common/src/performance/graphql-dataloader.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import DataLoader from 'dataloader'
22
import { Logger } from '@graphprotocol/common-ts'
33
import gql from 'graphql-tag'
44
import { SubgraphClient } from '../subgraph-client'
5+
import { Allocation } from '../allocations'
6+
import { SubgraphDeployment } from '../types'
57
import {
6-
Allocation,
7-
SubgraphDeployment,
88
parseGraphQLAllocation,
99
parseGraphQLSubgraphDeployment
10-
} from '../allocations'
10+
} from '../indexer-management/types'
1111

1212
export interface DataLoaderOptions {
1313
cache?: boolean
@@ -80,7 +80,8 @@ export class GraphQLDataLoader {
8080
* Load multiple allocations
8181
*/
8282
async loadAllocations(ids: string[]): Promise<(Allocation | null)[]> {
83-
return this.allocationLoader.loadMany(ids)
83+
const results = await this.allocationLoader.loadMany(ids)
84+
return results.map(result => (result instanceof Error ? null : result))
8485
}
8586

8687
/**
@@ -104,7 +105,8 @@ export class GraphQLDataLoader {
104105
* Load multiple deployments
105106
*/
106107
async loadDeployments(ids: string[]): Promise<(SubgraphDeployment | null)[]> {
107-
return this.deploymentLoader.loadMany(ids)
108+
const results = await this.deploymentLoader.loadMany(ids)
109+
return results.map(result => (result instanceof Error ? null : result))
108110
}
109111

110112
/**

0 commit comments

Comments
 (0)