Skip to content

Commit

Permalink
common: Fix handling of indexingStatus responses from graph-node
Browse files Browse the repository at this point in the history
The `paused` field is optional.
  • Loading branch information
fordN committed Jul 16, 2024
1 parent 5c684cb commit 809e747
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/indexer-common/src/graph-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,16 @@ export class GraphNode {
type QueryResult = {
subgraphDeployment: string
node: string
paused: boolean
paused: boolean | undefined
}

return result.data.indexingStatuses
.filter((status: QueryResult) => {
if (subgraphStatus === SubgraphStatus.ACTIVE) {
return !status.paused
return status.paused === false || (status.paused === undefined && status.node === 'removed')
} else if (subgraphStatus === SubgraphStatus.PAUSED) {
return status.node === 'removed' || status.paused === true
} else {
} else if (subgraphStatus === SubgraphStatus.ALL) {
return true
}
})
Expand Down

0 comments on commit 809e747

Please sign in to comment.