From 07ce12059f25da0523abadc839bb531e7cd60501 Mon Sep 17 00:00:00 2001 From: Aleix Date: Wed, 15 Nov 2023 12:14:50 +0100 Subject: [PATCH] Searching for plugin address in pluginMembers --- packages/js-client/src/internal/graphql-queries/members.ts | 2 +- packages/subgraph/schema.graphql | 1 + packages/subgraph/src/plugin/governance-erc20.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/js-client/src/internal/graphql-queries/members.ts b/packages/js-client/src/internal/graphql-queries/members.ts index 7dfd3075..665d8a4f 100644 --- a/packages/js-client/src/internal/graphql-queries/members.ts +++ b/packages/js-client/src/internal/graphql-queries/members.ts @@ -2,7 +2,7 @@ import { gql } from 'graphql-request'; export const QueryPluginMembers = gql` query PluginMembers($address: String!, $block: Block_height) { - pluginMembers(block: $block, where: { address: $address }) { + pluginMembers(block: $block, where: { pluginAddress: $address }) { id address balance diff --git a/packages/subgraph/schema.graphql b/packages/subgraph/schema.graphql index db59b57c..17183a1b 100644 --- a/packages/subgraph/schema.graphql +++ b/packages/subgraph/schema.graphql @@ -68,6 +68,7 @@ type PluginMember @entity { address: String # address as string to facilitate filtering by address on the UI balance: BigInt! plugin: Plugin! + pluginAddress: String! # address as string to facilitate filtering by address on the UI proposals: [PluginProposalMember!]! @derivedFrom(field: "approver") delegatee: PluginMember votingPower: BigInt diff --git a/packages/subgraph/src/plugin/governance-erc20.ts b/packages/subgraph/src/plugin/governance-erc20.ts index d13ee79a..d242904e 100644 --- a/packages/subgraph/src/plugin/governance-erc20.ts +++ b/packages/subgraph/src/plugin/governance-erc20.ts @@ -15,7 +15,7 @@ function getOrCreateMember(user: Address, pluginId: string): PluginMember { member.address = user.toHexString(); member.balance = BigInt.zero(); member.plugin = pluginId; - + member.pluginAddress = dataSource.address().toHexString(); member.delegatee = null; member.votingPower = BigInt.zero(); }