From eb6733ee67f186e3d32d2e03d39ee2fb365234de Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 17 Oct 2022 17:52:06 +0800 Subject: [PATCH 1/5] Update "Comment" entity & introduced Handles entity --- generated/schema.ts | 259 +++++++++++++++++++----- schema.graphql | 476 +++++++++++++++++++++++--------------------- 2 files changed, 458 insertions(+), 277 deletions(-) diff --git a/generated/schema.ts b/generated/schema.ts index 32951cf..2de9fc4 100644 --- a/generated/schema.ts +++ b/generated/schema.ts @@ -2569,6 +2569,77 @@ export class Comment extends Entity { this.set("profile", Value.fromString(value)); } + get onChainContentURI(): string { + let value = this.get("onChainContentURI"); + return value!.toString(); + } + + set onChainContentURI(value: string) { + this.set("onChainContentURI", Value.fromString(value)); + } + + get createdAt(): string { + let value = this.get("createdAt"); + return value!.toString(); + } + + set createdAt(value: string) { + this.set("createdAt", Value.fromString(value)); + } + + get mirrors(): Array { + let value = this.get("mirrors"); + return value!.toStringArray(); + } + + set mirrors(value: Array) { + this.set("mirrors", Value.fromStringArray(value)); + } + + get publication(): string { + let value = this.get("publication"); + return value!.toString(); + } + + set publication(value: string) { + this.set("publication", Value.fromString(value)); + } + + get referenceModule(): string | null { + let value = this.get("referenceModule"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set referenceModule(value: string | null) { + if (!value) { + this.unset("referenceModule"); + } else { + this.set("referenceModule", Value.fromString(value)); + } + } + + get collectModule(): string { + let value = this.get("collectModule"); + return value!.toString(); + } + + set collectModule(value: string) { + this.set("collectModule", Value.fromString(value)); + } + + get profilePointed(): string { + let value = this.get("profilePointed"); + return value!.toString(); + } + + set profilePointed(value: string) { + this.set("profilePointed", Value.fromString(value)); + } + get stats(): string { let value = this.get("stats"); return value!.toString(); @@ -2587,22 +2658,21 @@ export class Comment extends Entity { this.set("metadata", Value.fromString(value)); } - get onChainContentURI(): string { - let value = this.get("onChainContentURI"); - return value!.toString(); - } - - set onChainContentURI(value: string) { - this.set("onChainContentURI", Value.fromString(value)); - } - - get createdAt(): string { - let value = this.get("createdAt"); - return value!.toString(); + get firstComment(): string | null { + let value = this.get("firstComment"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } } - set createdAt(value: string) { - this.set("createdAt", Value.fromString(value)); + set firstComment(value: string | null) { + if (!value) { + this.unset("firstComment"); + } else { + this.set("firstComment", Value.fromString(value)); + } } get appId(): string { @@ -2632,8 +2702,8 @@ export class Comment extends Entity { this.set("collectNftAddress", Value.fromString(value)); } - get firstComment(): string | null { - let value = this.get("firstComment"); + get reaction(): string | null { + let value = this.get("reaction"); if (!value || value.kind == ValueKind.NULL) { return null; } else { @@ -2641,11 +2711,11 @@ export class Comment extends Entity { } } - set firstComment(value: string | null) { + set reaction(value: string | null) { if (!value) { - this.unset("firstComment"); + this.unset("reaction"); } else { - this.set("firstComment", Value.fromString(value)); + this.set("reaction", Value.fromString(value)); } } @@ -2665,41 +2735,6 @@ export class Comment extends Entity { this.set("collectedBy", Value.fromString(value)); } } - - get reaction(): string | null { - let value = this.get("reaction"); - if (!value || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set reaction(value: string | null) { - if (!value) { - this.unset("reaction"); - } else { - this.set("reaction", Value.fromString(value)); - } - } - - get hasCollectedByMe(): boolean { - let value = this.get("hasCollectedByMe"); - return value!.toBoolean(); - } - - set hasCollectedByMe(value: boolean) { - this.set("hasCollectedByMe", Value.fromBoolean(value)); - } - - get mirrors(): Array { - let value = this.get("mirrors"); - return value!.toStringArray(); - } - - set mirrors(value: Array) { - this.set("mirrors", Value.fromStringArray(value)); - } } export class Owner extends Entity { @@ -2958,3 +2993,119 @@ export class NFT extends Entity { this.set("ercType", Value.fromString(value)); } } + +export class ReservedClaimableHandle extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert( + id != null, + "Cannot save ReservedClaimableHandle entity without an ID" + ); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type ReservedClaimableHandle must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + ); + store.set("ReservedClaimableHandle", id.toString(), this); + } + } + + static load(id: string): ReservedClaimableHandle | null { + return changetype( + store.get("ReservedClaimableHandle", id) + ); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get handle(): string { + let value = this.get("handle"); + return value!.toString(); + } + + set handle(value: string) { + this.set("handle", Value.fromString(value)); + } + + get source(): string { + let value = this.get("source"); + return value!.toString(); + } + + set source(value: string) { + this.set("source", Value.fromString(value)); + } + + get expiry(): string { + let value = this.get("expiry"); + return value!.toString(); + } + + set expiry(value: string) { + this.set("expiry", Value.fromString(value)); + } +} + +export class ClaimableHandles extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save ClaimableHandles entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type ClaimableHandles must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + ); + store.set("ClaimableHandles", id.toString(), this); + } + } + + static load(id: string): ClaimableHandles | null { + return changetype( + store.get("ClaimableHandles", id) + ); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get canClaimFreeTextHandle(): boolean { + let value = this.get("canClaimFreeTextHandle"); + return value!.toBoolean(); + } + + set canClaimFreeTextHandle(value: boolean) { + this.set("canClaimFreeTextHandle", Value.fromBoolean(value)); + } + + get claimableHandles(): Array { + let value = this.get("claimableHandles"); + return value!.toStringArray(); + } + + set claimableHandles(value: Array) { + this.set("claimableHandles", Value.fromStringArray(value)); + } +} diff --git a/schema.graphql b/schema.graphql index 4a876e9..40de32b 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1,333 +1,363 @@ type Approval @entity { - id: ID! - owner: Bytes! # address - approved: Bytes! # address - tokenId: BigInt! # uint256 + id: ID! + owner: Bytes! # address + approved: Bytes! # address + tokenId: BigInt! # uint256 } type ApprovalForAll @entity { - id: ID! - owner: Bytes! # address - operator: Bytes! # address - approved: Boolean! # bool + id: ID! + owner: Bytes! # address + operator: Bytes! # address + approved: Boolean! # bool } type Transfer @entity { - id: ID! - from: Bytes! # address - to: Bytes! # address - tokenId: BigInt! # uint256 + id: ID! + from: Bytes! # address + to: Bytes! # address + tokenId: BigInt! # uint256 } type Dispatcher @entity { - id: ID! - address: String! - canUseRelay: Boolean! + id: ID! + address: String! + canUseRelay: Boolean! } type ProfileStats @entity { - id: ID! - totalFollowers: BigInt! - totalFollowing: BigInt! - totalPosts: BigInt! - totalComments: BigInt! - totalMirrors: BigInt! - totalPublications: BigInt! - totalCollects: BigInt! + id: ID! + totalFollowers: BigInt! + totalFollowing: BigInt! + totalPosts: BigInt! + totalComments: BigInt! + totalMirrors: BigInt! + totalPublications: BigInt! + totalCollects: BigInt! } type NftImage @entity { - id: ID! - contractAddress: String! - tokenId: String! - url: String! - chainId: BigInt! - verified: Boolean! + id: ID! + contractAddress: String! + tokenId: String! + url: String! + chainId: BigInt! + verified: Boolean! } type Media @entity { - id: ID! - url: String! - width: BigInt - height: BigInt - size: BigInt - mimeType: String + id: ID! + url: String! + width: BigInt + height: BigInt + size: BigInt + mimeType: String } type MediaSet @entity { - id: ID! - original: Media! - small: Media - medium: Media + id: ID! + original: Media! + small: Media + medium: Media } enum ProfileMedia { - NftImage - MediaSet + NftImage + MediaSet } type Erc20 @entity { - id: ID! - name: String! - symbol: String! - decimals: BigInt! - address: String! + id: ID! + name: String! + symbol: String! + decimals: BigInt! + address: String! } type ModuleFeeAmount @entity { - id: ID! - asset: Erc20! - vaue: String! + id: ID! + asset: Erc20! + vaue: String! } type FeeFollowModuleSettings @entity { - id: ID! - contractAddress: String! - amount: ModuleFeeAmount! - recipient: String! + id: ID! + contractAddress: String! + amount: ModuleFeeAmount! + recipient: String! } type ProfileFollowModuleSettings @entity { - id: ID! - contractAddress: String! + id: ID! + contractAddress: String! } type RevertFollowModuleSettings @entity { - id: ID! - contractAddress: String! + id: ID! + contractAddress: String! } enum FollowModule { - FeeFollowModuleSettings - ProfileFollowModuleSettings - RevertFollowModuleSettings + FeeFollowModuleSettings + ProfileFollowModuleSettings + RevertFollowModuleSettings } type Attribute @entity { - id: ID! - displayType: String - traitType: String - key: String! - value: String! + id: ID! + displayType: String + traitType: String + key: String! + value: String! } type Profile @entity { - id: ID! - name: String - bio: String - followNftAddress: String - metadata: String - handle: String! - picture: ProfileMedia - coverPicture: ProfileMedia - onwnedBy: String! - dispatcher: Dispatcher - stats: ProfileStats - followModule: FollowModule - isDefault: Boolean - attributes: [Attribute!] - isFollowedByMe: Boolean - isFollowingMe: Boolean + id: ID! + name: String + bio: String + followNftAddress: String + metadata: String + handle: String! + picture: ProfileMedia + coverPicture: ProfileMedia + onwnedBy: String! + dispatcher: Dispatcher + stats: ProfileStats + followModule: FollowModule + isDefault: Boolean + attributes: [Attribute!] + isFollowedByMe: Boolean + isFollowingMe: Boolean } enum ReactionTypes { - UPVOTE - DOWNVOTE + UPVOTE + DOWNVOTE } type PublicationStats @entity { - id: ID! - totalAmountOfMirrors: BigInt! - totalAmountOfCollects: BigInt! - totalAmountOfComments: BigInt! - totalUpvotes: BigInt! - totalDownvotes: BigInt! + id: ID! + totalAmountOfMirrors: BigInt! + totalAmountOfCollects: BigInt! + totalAmountOfComments: BigInt! + totalUpvotes: BigInt! + totalDownvotes: BigInt! } type Wallet @entity { - id: ID! - address: String! - defaulProfile: Profile! + id: ID! + address: String! + defaulProfile: Profile! } enum MetadataDisplayType { - BigInt - String - String + BigInt + String + String } type MetadataAttributeOutput @entity { - id: ID! - displayType: MetadataDisplayType - traitType: String - value: String + id: ID! + displayType: MetadataDisplayType + traitType: String + value: String } type MetadataOutput @entity { - id: ID! - name: String - description: String - content: String - image: String - cover: MediaSet - media: [MediaSet!]! - attributes: [MetadataAttributeOutput!]! + id: ID! + name: String + description: String + content: String + image: String + cover: MediaSet + media: [MediaSet!]! + attributes: [MetadataAttributeOutput!]! } type ReactionFieldResolverRequest @entity { - id: ID! - profileId: BigInt + id: ID! + profileId: BigInt } - -enum CollectModules { - LimitedFeeCollectModule - FeeCollectModule - LimitedTimedFeeCollectModule - TimedFeeCollectModule - RevertCollectModule - FreeCollectModule +enum CollectModule { + LimitedFeeCollectModule + FeeCollectModule + LimitedTimedFeeCollectModule + TimedFeeCollectModule + RevertCollectModule + FreeCollectModule } type FreeCollectModuleSettings @entity { - id: ID! - type: CollectModules! - contractAddress: String! - followerOnly: Boolean! + id: ID! + type: CollectModule! + contractAddress: String! + followerOnly: Boolean! } type FeeCollectModuleSettings @entity { - id: ID! - type: CollectModules! - contractAddress: String! - amount: ModuleFeeAmount! - recipient: String! - referralFee: BigDecimal! - followerOnly: Boolean! + id: ID! + type: CollectModule! + contractAddress: String! + amount: ModuleFeeAmount! + recipient: String! + referralFee: BigDecimal! + followerOnly: Boolean! } type LimitedFeeCollectModule @entity { - id: ID! - type: CollectModules! - contractAddress: String! - collectLimit: String! - amount: ModuleFeeAmount! - recipient: String! - referralFee: BigDecimal! - followerOnly: Boolean! + id: ID! + type: CollectModule! + contractAddress: String! + collectLimit: String! + amount: ModuleFeeAmount! + recipient: String! + referralFee: BigDecimal! + followerOnly: Boolean! } type LimitedTimedFeeCollectModuleSettings @entity { - id: ID! - type: CollectModules! - contractAddress: String! - collectLimit: String! - amount: ModuleFeeAmount! - recipient: String! - referralFee: BigDecimal! - followerOnly: Boolean! - endTimestamp: String! + id: ID! + type: CollectModule! + contractAddress: String! + collectLimit: String! + amount: ModuleFeeAmount! + recipient: String! + referralFee: BigDecimal! + followerOnly: Boolean! + endTimestamp: String! } type RevertCollectModuleSettings @entity { - id: ID! - type: CollectModules! - contractAddress: String! + id: ID! + type: CollectModule! + contractAddress: String! } type TimedFeeCollectModuleSettings @entity { - id: ID! - type: CollectModules! - contractAddress: String! - amount: ModuleFeeAmount! - recipient: String! - referralFee: BigDecimal! - followerOnly: Boolean! - endTimestamp: String! + id: ID! + type: CollectModule! + contractAddress: String! + amount: ModuleFeeAmount! + recipient: String! + referralFee: BigDecimal! + followerOnly: Boolean! + endTimestamp: String! } -enum ReferenceModules { - FollowOnlyReferenceModule +enum ReferenceModule { + FollowOnlyReferenceModule } type FollowOnlyReferenceModuleSettings @entity { - id: ID! - type: ReferenceModules! - contractAddress: String! + id: ID! + type: ReferenceModule! + contractAddress: String! } type Mirror @entity { - id: ID! - profile: Profile! - stats: PublicationStats! - metadata: MetadataOutput! - onChainContentURI: String! - createdAt: String! - appId: BigInt - hidden: Boolean! - collectNftAddress: String - reaction: ReactionTypes - hasCollectedByMe: Boolean! + id: ID! + profile: Profile! + stats: PublicationStats! + metadata: MetadataOutput! + onChainContentURI: String! + createdAt: String! + appId: BigInt + hidden: Boolean! + collectNftAddress: String + reaction: ReactionTypes + hasCollectedByMe: Boolean! } type Post @entity { - id: ID! - profile: Profile - stats: PublicationStats - metadata: MetadataOutput - onChainContentURI: String! - createdAt: String! - appId: String - hidden: Boolean - collectNftAddress: String - collectedBy: Wallet - reaction: ReactionTypes - hasCollectedByMe: Boolean - mirrors: [ID!] -} - -type Comment @entity{ - id: ID! - profile: Profile! - stats: PublicationStats! - metadata: MetadataOutput! - onChainContentURI: String! - createdAt: String! - appId: String! - hidden: Boolean! - collectNftAddress: String! - firstComment:Comment - collectedBy:Wallet - reaction:ReactionTypes - hasCollectedByMe: Boolean! - mirrors:[ID!]! + id: ID! + profile: Profile + stats: PublicationStats + metadata: MetadataOutput + onChainContentURI: String! + createdAt: String! + appId: String + hidden: Boolean + collectNftAddress: String + collectedBy: Wallet + reaction: ReactionTypes + hasCollectedByMe: Boolean + mirrors: [ID!] +} + +# TODO: We need to make "Comment" extend from "Publication" +type Comment @entity { + id: ID! + profile: Profile! + onChainContentURI: String! + createdAt: String! + mirrors: [ID!]! + + # Publication that comment points to + publication: Post! + # Reference module settings for this comment + referenceModule: ReferenceModule + # Collect module settings for this comment + collectModule: CollectModule! + # Profile that comment points to (may be different than comment author) + profilePointed: Profile! + + ##### + # Retrieved from https://graphiql-online.com (Voyager view) - not sure if we need them + stats: PublicationStats! + metadata: MetadataOutput! + + firstComment: Comment + appId: String! + hidden: Boolean! + collectNftAddress: String! + reaction: ReactionTypes + collectedBy: Wallet + ##### + + # Proposal to remove fields + # hasCollectedByMe: Boolean! } type Owner @entity { - id: ID! - amount: BigDecimal! - address: String! + id: ID! + amount: BigDecimal! + address: String! } type NFTContent @entity { - id: ID! - uri: String! - metaType: String! - animatedUrl: String + id: ID! + uri: String! + metaType: String! + animatedUrl: String } type NFT @entity { - id: ID! - contractName: String! - contractAddress: String! - symbol: String! - tokenId: String! - owners: [Owner!]! - name: String! - description: String! - contentURI: String! - originalContent: NFTContent! - chainId: ID! - collectionName: String! - ercType: String! -} \ No newline at end of file + id: ID! + contractName: String! + contractAddress: String! + symbol: String! + tokenId: String! + owners: [Owner!]! + name: String! + description: String! + contentURI: String! + originalContent: NFTContent! + chainId: ID! + collectionName: String! + ercType: String! +} + +type ReservedClaimableHandle @entity { + id: ID! + # Requires custom "Handle" scalar type + handle: String! + source: String! + expiry: String! +} + +type ClaimableHandles @entity { + id: ID! + canClaimFreeTextHandle: Boolean! + claimableHandles: [ReservedClaimableHandle!]! +} From 8ff4f32790615c813db754f1b2c60106d2e43efe Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 17 Oct 2022 18:00:44 +0800 Subject: [PATCH 2/5] Introduce transaction receipt entity --- generated/schema.ts | 194 ++++++++++++++++++++++++++++++++++++++++++++ schema.graphql | 27 ++++++ 2 files changed, 221 insertions(+) diff --git a/generated/schema.ts b/generated/schema.ts index 2de9fc4..6e41f9d 100644 --- a/generated/schema.ts +++ b/generated/schema.ts @@ -3109,3 +3109,197 @@ export class ClaimableHandles extends Entity { this.set("claimableHandles", Value.fromStringArray(value)); } } + +export class TransactionReceipt extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save TransactionReceipt entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type TransactionReceipt must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + ); + store.set("TransactionReceipt", id.toString(), this); + } + } + + static load(id: string): TransactionReceipt | null { + return changetype( + store.get("TransactionReceipt", id) + ); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get to(): string { + let value = this.get("to"); + return value!.toString(); + } + + set to(value: string) { + this.set("to", Value.fromString(value)); + } + + get from(): string { + let value = this.get("from"); + return value!.toString(); + } + + set from(value: string) { + this.set("from", Value.fromString(value)); + } + + get contractAddress(): string | null { + let value = this.get("contractAddress"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set contractAddress(value: string | null) { + if (!value) { + this.unset("contractAddress"); + } else { + this.set("contractAddress", Value.fromString(value)); + } + } + + get transactionIndex(): i32 { + let value = this.get("transactionIndex"); + return value!.toI32(); + } + + set transactionIndex(value: i32) { + this.set("transactionIndex", Value.fromI32(value)); + } + + get root(): string | null { + let value = this.get("root"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set root(value: string | null) { + if (!value) { + this.unset("root"); + } else { + this.set("root", Value.fromString(value)); + } + } + + get gasUsed(): string { + let value = this.get("gasUsed"); + return value!.toString(); + } + + set gasUsed(value: string) { + this.set("gasUsed", Value.fromString(value)); + } + + get logsBloom(): string { + let value = this.get("logsBloom"); + return value!.toString(); + } + + set logsBloom(value: string) { + this.set("logsBloom", Value.fromString(value)); + } + + get blockHash(): string { + let value = this.get("blockHash"); + return value!.toString(); + } + + set blockHash(value: string) { + this.set("blockHash", Value.fromString(value)); + } + + get transactionHash(): string { + let value = this.get("transactionHash"); + return value!.toString(); + } + + set transactionHash(value: string) { + this.set("transactionHash", Value.fromString(value)); + } + + get blockNumber(): i32 { + let value = this.get("blockNumber"); + return value!.toI32(); + } + + set blockNumber(value: i32) { + this.set("blockNumber", Value.fromI32(value)); + } + + get confirmations(): i32 { + let value = this.get("confirmations"); + return value!.toI32(); + } + + set confirmations(value: i32) { + this.set("confirmations", Value.fromI32(value)); + } + + get cumulativeGasUsed(): string { + let value = this.get("cumulativeGasUsed"); + return value!.toString(); + } + + set cumulativeGasUsed(value: string) { + this.set("cumulativeGasUsed", Value.fromString(value)); + } + + get effectiveGasPrice(): string { + let value = this.get("effectiveGasPrice"); + return value!.toString(); + } + + set effectiveGasPrice(value: string) { + this.set("effectiveGasPrice", Value.fromString(value)); + } + + get byzantium(): boolean { + let value = this.get("byzantium"); + return value!.toBoolean(); + } + + set byzantium(value: boolean) { + this.set("byzantium", Value.fromBoolean(value)); + } + + get type(): i32 { + let value = this.get("type"); + return value!.toI32(); + } + + set type(value: i32) { + this.set("type", Value.fromI32(value)); + } + + get status(): i32 { + let value = this.get("status"); + return value!.toI32(); + } + + set status(value: i32) { + this.set("status", Value.fromI32(value)); + } +} diff --git a/schema.graphql b/schema.graphql index 40de32b..29b0b10 100644 --- a/schema.graphql +++ b/schema.graphql @@ -348,6 +348,10 @@ type NFT @entity { ercType: String! } +# Handles +#12 + +# Retrieved from https://graphiql-online.com/voyager-view type ReservedClaimableHandle @entity { id: ID! # Requires custom "Handle" scalar type @@ -361,3 +365,26 @@ type ClaimableHandles @entity { canClaimFreeTextHandle: Boolean! claimableHandles: [ReservedClaimableHandle!]! } + +# Address +#13 + +type TransactionReceipt @entity { + id: ID! + to: String! + from: String! + contractAddress: String + transactionIndex: Int! + root: String + gasUsed: String! + logsBloom: String! + blockHash: String! + transactionHash: String! + blockNumber: Int! + confirmations: Int! + cumulativeGasUsed: String! + effectiveGasPrice: String! + byzantium: Boolean! + type: Int! + status: Int +} From 8b00630e0d3c7098b0e3826879b4b3295566167b Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 20 Oct 2022 23:10:30 +0800 Subject: [PATCH 3/5] Uncomment "hasCollectedByMe" --- schema.graphql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema.graphql b/schema.graphql index 29b0b10..e42a84c 100644 --- a/schema.graphql +++ b/schema.graphql @@ -316,7 +316,7 @@ type Comment @entity { ##### # Proposal to remove fields - # hasCollectedByMe: Boolean! + hasCollectedByMe: Boolean! } type Owner @entity { From 2332019d3ee4ffff23a36997027c871a122fe655 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 20 Oct 2022 23:19:24 +0800 Subject: [PATCH 4/5] Generated schema code --- generated/schema.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/generated/schema.ts b/generated/schema.ts index 6e41f9d..b8c4ac4 100644 --- a/generated/schema.ts +++ b/generated/schema.ts @@ -2735,6 +2735,15 @@ export class Comment extends Entity { this.set("collectedBy", Value.fromString(value)); } } + + get hasCollectedByMe(): boolean { + let value = this.get("hasCollectedByMe"); + return value!.toBoolean(); + } + + set hasCollectedByMe(value: boolean) { + this.set("hasCollectedByMe", Value.fromBoolean(value)); + } } export class Owner extends Entity { From 55cb97d55c4acc14d2d359b261efdd9a596a062e Mon Sep 17 00:00:00 2001 From: Nazeeh Vahora Date: Tue, 25 Oct 2022 21:06:06 +0530 Subject: [PATCH 5/5] Update schema.graphql --- schema.graphql | 514 ++++++++++++++++++++++++------------------------- 1 file changed, 257 insertions(+), 257 deletions(-) diff --git a/schema.graphql b/schema.graphql index e42a84c..0d9a44d 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1,351 +1,351 @@ type Approval @entity { - id: ID! - owner: Bytes! # address - approved: Bytes! # address - tokenId: BigInt! # uint256 + id: ID! + owner: Bytes! # address + approved: Bytes! # address + tokenId: BigInt! # uint256 } type ApprovalForAll @entity { - id: ID! - owner: Bytes! # address - operator: Bytes! # address - approved: Boolean! # bool + id: ID! + owner: Bytes! # address + operator: Bytes! # address + approved: Boolean! # bool } type Transfer @entity { - id: ID! - from: Bytes! # address - to: Bytes! # address - tokenId: BigInt! # uint256 + id: ID! + from: Bytes! # address + to: Bytes! # address + tokenId: BigInt! # uint256 } type Dispatcher @entity { - id: ID! - address: String! - canUseRelay: Boolean! + id: ID! + address: String! + canUseRelay: Boolean! } type ProfileStats @entity { - id: ID! - totalFollowers: BigInt! - totalFollowing: BigInt! - totalPosts: BigInt! - totalComments: BigInt! - totalMirrors: BigInt! - totalPublications: BigInt! - totalCollects: BigInt! + id: ID! + totalFollowers: BigInt! + totalFollowing: BigInt! + totalPosts: BigInt! + totalComments: BigInt! + totalMirrors: BigInt! + totalPublications: BigInt! + totalCollects: BigInt! } type NftImage @entity { - id: ID! - contractAddress: String! - tokenId: String! - url: String! - chainId: BigInt! - verified: Boolean! + id: ID! + contractAddress: String! + tokenId: String! + url: String! + chainId: BigInt! + verified: Boolean! } type Media @entity { - id: ID! - url: String! - width: BigInt - height: BigInt - size: BigInt - mimeType: String + id: ID! + url: String! + width: BigInt + height: BigInt + size: BigInt + mimeType: String } type MediaSet @entity { - id: ID! - original: Media! - small: Media - medium: Media + id: ID! + original: Media! + small: Media + medium: Media } enum ProfileMedia { - NftImage - MediaSet + NftImage + MediaSet } type Erc20 @entity { - id: ID! - name: String! - symbol: String! - decimals: BigInt! - address: String! + id: ID! + name: String! + symbol: String! + decimals: BigInt! + address: String! } type ModuleFeeAmount @entity { - id: ID! - asset: Erc20! - vaue: String! + id: ID! + asset: Erc20! + vaue: String! } type FeeFollowModuleSettings @entity { - id: ID! - contractAddress: String! - amount: ModuleFeeAmount! - recipient: String! + id: ID! + contractAddress: String! + amount: ModuleFeeAmount! + recipient: String! } type ProfileFollowModuleSettings @entity { - id: ID! - contractAddress: String! + id: ID! + contractAddress: String! } type RevertFollowModuleSettings @entity { - id: ID! - contractAddress: String! + id: ID! + contractAddress: String! } enum FollowModule { - FeeFollowModuleSettings - ProfileFollowModuleSettings - RevertFollowModuleSettings + FeeFollowModuleSettings + ProfileFollowModuleSettings + RevertFollowModuleSettings } type Attribute @entity { - id: ID! - displayType: String - traitType: String - key: String! - value: String! + id: ID! + displayType: String + traitType: String + key: String! + value: String! } type Profile @entity { - id: ID! - name: String - bio: String - followNftAddress: String - metadata: String - handle: String! - picture: ProfileMedia - coverPicture: ProfileMedia - onwnedBy: String! - dispatcher: Dispatcher - stats: ProfileStats - followModule: FollowModule - isDefault: Boolean - attributes: [Attribute!] - isFollowedByMe: Boolean - isFollowingMe: Boolean + id: ID! + name: String + bio: String + followNftAddress: String + metadata: String + handle: String! + picture: ProfileMedia + coverPicture: ProfileMedia + onwnedBy: String! + dispatcher: Dispatcher + stats: ProfileStats + followModule: FollowModule + isDefault: Boolean + attributes: [Attribute!] + isFollowedByMe: Boolean + isFollowingMe: Boolean } enum ReactionTypes { - UPVOTE - DOWNVOTE + UPVOTE + DOWNVOTE } type PublicationStats @entity { - id: ID! - totalAmountOfMirrors: BigInt! - totalAmountOfCollects: BigInt! - totalAmountOfComments: BigInt! - totalUpvotes: BigInt! - totalDownvotes: BigInt! + id: ID! + totalAmountOfMirrors: BigInt! + totalAmountOfCollects: BigInt! + totalAmountOfComments: BigInt! + totalUpvotes: BigInt! + totalDownvotes: BigInt! } type Wallet @entity { - id: ID! - address: String! - defaulProfile: Profile! + id: ID! + address: String! + defaulProfile: Profile! } enum MetadataDisplayType { - BigInt - String - String + BigInt + String + String } type MetadataAttributeOutput @entity { - id: ID! - displayType: MetadataDisplayType - traitType: String - value: String + id: ID! + displayType: MetadataDisplayType + traitType: String + value: String } type MetadataOutput @entity { - id: ID! - name: String - description: String - content: String - image: String - cover: MediaSet - media: [MediaSet!]! - attributes: [MetadataAttributeOutput!]! + id: ID! + name: String + description: String + content: String + image: String + cover: MediaSet + media: [MediaSet!]! + attributes: [MetadataAttributeOutput!]! } type ReactionFieldResolverRequest @entity { - id: ID! - profileId: BigInt + id: ID! + profileId: BigInt } enum CollectModule { - LimitedFeeCollectModule - FeeCollectModule - LimitedTimedFeeCollectModule - TimedFeeCollectModule - RevertCollectModule - FreeCollectModule + LimitedFeeCollectModule + FeeCollectModule + LimitedTimedFeeCollectModule + TimedFeeCollectModule + RevertCollectModule + FreeCollectModule } type FreeCollectModuleSettings @entity { - id: ID! - type: CollectModule! - contractAddress: String! - followerOnly: Boolean! + id: ID! + type: CollectModule! + contractAddress: String! + followerOnly: Boolean! } type FeeCollectModuleSettings @entity { - id: ID! - type: CollectModule! - contractAddress: String! - amount: ModuleFeeAmount! - recipient: String! - referralFee: BigDecimal! - followerOnly: Boolean! + id: ID! + type: CollectModule! + contractAddress: String! + amount: ModuleFeeAmount! + recipient: String! + referralFee: BigDecimal! + followerOnly: Boolean! } type LimitedFeeCollectModule @entity { - id: ID! - type: CollectModule! - contractAddress: String! - collectLimit: String! - amount: ModuleFeeAmount! - recipient: String! - referralFee: BigDecimal! - followerOnly: Boolean! + id: ID! + type: CollectModule! + contractAddress: String! + collectLimit: String! + amount: ModuleFeeAmount! + recipient: String! + referralFee: BigDecimal! + followerOnly: Boolean! } type LimitedTimedFeeCollectModuleSettings @entity { - id: ID! - type: CollectModule! - contractAddress: String! - collectLimit: String! - amount: ModuleFeeAmount! - recipient: String! - referralFee: BigDecimal! - followerOnly: Boolean! - endTimestamp: String! + id: ID! + type: CollectModule! + contractAddress: String! + collectLimit: String! + amount: ModuleFeeAmount! + recipient: String! + referralFee: BigDecimal! + followerOnly: Boolean! + endTimestamp: String! } type RevertCollectModuleSettings @entity { - id: ID! - type: CollectModule! - contractAddress: String! + id: ID! + type: CollectModule! + contractAddress: String! } type TimedFeeCollectModuleSettings @entity { - id: ID! - type: CollectModule! - contractAddress: String! - amount: ModuleFeeAmount! - recipient: String! - referralFee: BigDecimal! - followerOnly: Boolean! - endTimestamp: String! + id: ID! + type: CollectModule! + contractAddress: String! + amount: ModuleFeeAmount! + recipient: String! + referralFee: BigDecimal! + followerOnly: Boolean! + endTimestamp: String! } enum ReferenceModule { - FollowOnlyReferenceModule + FollowOnlyReferenceModule } type FollowOnlyReferenceModuleSettings @entity { - id: ID! - type: ReferenceModule! - contractAddress: String! + id: ID! + type: ReferenceModule! + contractAddress: String! } type Mirror @entity { - id: ID! - profile: Profile! - stats: PublicationStats! - metadata: MetadataOutput! - onChainContentURI: String! - createdAt: String! - appId: BigInt - hidden: Boolean! - collectNftAddress: String - reaction: ReactionTypes - hasCollectedByMe: Boolean! + id: ID! + profile: Profile! + stats: PublicationStats! + metadata: MetadataOutput! + onChainContentURI: String! + createdAt: String! + appId: BigInt + hidden: Boolean! + collectNftAddress: String + reaction: ReactionTypes + hasCollectedByMe: Boolean! } type Post @entity { - id: ID! - profile: Profile - stats: PublicationStats - metadata: MetadataOutput - onChainContentURI: String! - createdAt: String! - appId: String - hidden: Boolean - collectNftAddress: String - collectedBy: Wallet - reaction: ReactionTypes - hasCollectedByMe: Boolean - mirrors: [ID!] + id: ID! + profile: Profile + stats: PublicationStats + metadata: MetadataOutput + onChainContentURI: String! + createdAt: String! + appId: String + hidden: Boolean + collectNftAddress: String + collectedBy: Wallet + reaction: ReactionTypes + hasCollectedByMe: Boolean + mirrors: [ID!] } # TODO: We need to make "Comment" extend from "Publication" type Comment @entity { - id: ID! - profile: Profile! - onChainContentURI: String! - createdAt: String! - mirrors: [ID!]! - - # Publication that comment points to - publication: Post! - # Reference module settings for this comment - referenceModule: ReferenceModule - # Collect module settings for this comment - collectModule: CollectModule! - # Profile that comment points to (may be different than comment author) - profilePointed: Profile! - - ##### - # Retrieved from https://graphiql-online.com (Voyager view) - not sure if we need them - stats: PublicationStats! - metadata: MetadataOutput! - - firstComment: Comment - appId: String! - hidden: Boolean! - collectNftAddress: String! - reaction: ReactionTypes - collectedBy: Wallet - ##### - - # Proposal to remove fields - hasCollectedByMe: Boolean! + id: ID! + profile: Profile! + onChainContentURI: String! + createdAt: String! + mirrors: [ID!]! + + # Publication that comment points to + publication: Post! + # Reference module settings for this comment + referenceModule: ReferenceModule + # Collect module settings for this comment + collectModule: CollectModule! + # Profile that comment points to (may be different than comment author) + profilePointed: Profile! + + ##### + # Retrieved from https://graphiql-online.com (Voyager view) - not sure if we need them + stats: PublicationStats! + metadata: MetadataOutput! + + firstComment: Comment + appId: String! + hidden: Boolean! + collectNftAddress: String! + reaction: ReactionTypes + collectedBy: Wallet + ##### + + # Proposal to remove fields + hasCollectedByMe: Boolean! } type Owner @entity { - id: ID! - amount: BigDecimal! - address: String! + id: ID! + amount: BigDecimal! + address: String! } type NFTContent @entity { - id: ID! - uri: String! - metaType: String! - animatedUrl: String + id: ID! + uri: String! + metaType: String! + animatedUrl: String } type NFT @entity { - id: ID! - contractName: String! - contractAddress: String! - symbol: String! - tokenId: String! - owners: [Owner!]! - name: String! - description: String! - contentURI: String! - originalContent: NFTContent! - chainId: ID! - collectionName: String! - ercType: String! + id: ID! + contractName: String! + contractAddress: String! + symbol: String! + tokenId: String! + owners: [Owner!]! + name: String! + description: String! + contentURI: String! + originalContent: NFTContent! + chainId: ID! + collectionName: String! + ercType: String! } # Handles @@ -353,38 +353,38 @@ type NFT @entity { # Retrieved from https://graphiql-online.com/voyager-view type ReservedClaimableHandle @entity { - id: ID! - # Requires custom "Handle" scalar type - handle: String! - source: String! - expiry: String! + id: ID! + # Requires custom "Handle" scalar type + handle: String! + source: String! + expiry: String! } type ClaimableHandles @entity { - id: ID! - canClaimFreeTextHandle: Boolean! - claimableHandles: [ReservedClaimableHandle!]! + id: ID! + canClaimFreeTextHandle: Boolean! + claimableHandles: [ReservedClaimableHandle!]! } # Address #13 type TransactionReceipt @entity { - id: ID! - to: String! - from: String! - contractAddress: String - transactionIndex: Int! - root: String - gasUsed: String! - logsBloom: String! - blockHash: String! - transactionHash: String! - blockNumber: Int! - confirmations: Int! - cumulativeGasUsed: String! - effectiveGasPrice: String! - byzantium: Boolean! - type: Int! - status: Int + id: ID! + to: String! + from: String! + contractAddress: String + transactionIndex: Int! + root: String + gasUsed: String! + logsBloom: String! + blockHash: String! + transactionHash: String! + blockNumber: Int! + confirmations: Int! + cumulativeGasUsed: String! + effectiveGasPrice: String! + byzantium: Boolean! + type: Int! + status: Int }