From 6fac0bb8128e2f56d87f75ff67a8efee662d386c Mon Sep 17 00:00:00 2001 From: sirpy Date: Sun, 4 Feb 2024 12:01:59 +0200 Subject: [PATCH] fix: null ipfs --- packages/app/src/subgraph/useSubgraphCollective.ts | 2 +- packages/app/src/subgraph/useSubgraphIpfsCollective.ts | 3 ++- packages/sdk-js/src/goodcollective/goodcollective.ts | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/app/src/subgraph/useSubgraphCollective.ts b/packages/app/src/subgraph/useSubgraphCollective.ts index 37e05151..dbf75b28 100644 --- a/packages/app/src/subgraph/useSubgraphCollective.ts +++ b/packages/app/src/subgraph/useSubgraphCollective.ts @@ -4,7 +4,7 @@ import { SubgraphCollective } from './subgraphModels'; export const collectivesById = gql` query COLLECTIVES_BY_ID($ids: [String!]) { - collectives(where: { id_in: $ids }) { + collectives(where: { id_in: $ids, ipfs_: { name_not: null } }) { id ipfs { id diff --git a/packages/app/src/subgraph/useSubgraphIpfsCollective.ts b/packages/app/src/subgraph/useSubgraphIpfsCollective.ts index 1737fc58..60f517ee 100644 --- a/packages/app/src/subgraph/useSubgraphIpfsCollective.ts +++ b/packages/app/src/subgraph/useSubgraphIpfsCollective.ts @@ -2,9 +2,10 @@ import { gql } from '@apollo/client'; import { IpfsCollectivesSubgraphResponse, useSubgraphData } from './useSubgraphData'; import { SubgraphIpfsCollective } from './subgraphModels'; +// filter by name not null, because it can take time until thegraph index from ipfs, and if ipfs fields are null it will break the query const allIpfsCollectives = gql` query IPFS_COLLECTIVES { - collectives { + collectives(where: { ipfs_: { name_not: null } }) { id ipfs { id diff --git a/packages/sdk-js/src/goodcollective/goodcollective.ts b/packages/sdk-js/src/goodcollective/goodcollective.ts index ea924c74..ce23c017 100644 --- a/packages/sdk-js/src/goodcollective/goodcollective.ts +++ b/packages/sdk-js/src/goodcollective/goodcollective.ts @@ -14,14 +14,18 @@ export type EventData = ProvableNFT.EventDataStruct; export type PoolSettings = Omit & { nftType?: BigNumberish }; export type PoolLimits = DirectPaymentsPool.SafetyLimitsStruct; export type SwapData = HelperLibrary.SwapDataStruct; + export type PoolAttributes = { name: string; description: string; + headerImage: string; + logo: string; twitter?: string; email?: string; instagram?: string; threads?: string; website?: string; + images?: Array; }; export type SDKOptions = { network?: string;