diff --git a/packages/backend/src/handlers/remote-schemas/resolvers/getBoxProfile/resolver.ts b/packages/backend/src/handlers/remote-schemas/resolvers/getBoxProfile/resolver.ts index 09bcd52a..34868d51 100644 --- a/packages/backend/src/handlers/remote-schemas/resolvers/getBoxProfile/resolver.ts +++ b/packages/backend/src/handlers/remote-schemas/resolvers/getBoxProfile/resolver.ts @@ -1,4 +1,4 @@ -import Box, { Image } from '3box'; +import Box, { CollectiblesFavorite, Image } from '3box'; import { CONFIG } from '../../../../config'; import { @@ -34,6 +34,9 @@ export const getBoxProfile: QueryResolvers['getBoxProfile'] = async ( height: 300, }), website: boxProfile.website, + collectiblesFavorites: getCollectiblesFavourites( + boxProfile.collectiblesFavorites, + ), }; }; @@ -47,3 +50,13 @@ function getImage( } return ''; } + +function getCollectiblesFavourites( + collectiblesFavorites: Array | null | undefined, +) { + if (!collectiblesFavorites) return []; + return collectiblesFavorites.map(({ address, token_id }) => ({ + address, + tokenId: token_id, + })); +} diff --git a/packages/backend/src/handlers/remote-schemas/typeDefs.ts b/packages/backend/src/handlers/remote-schemas/typeDefs.ts index 8146529c..319ff60d 100644 --- a/packages/backend/src/handlers/remote-schemas/typeDefs.ts +++ b/packages/backend/src/handlers/remote-schemas/typeDefs.ts @@ -16,6 +16,12 @@ export const typeDefs = gql` imageUrl: String coverImageUrl: String website: String + collectiblesFavorites: [CollectiblesFavorites!] + } + + type CollectiblesFavorites { + address: String + tokenId: String } type Moloch { diff --git a/packages/codegen/schema.graphql b/packages/codegen/schema.graphql index fc118083..3cbda0d4 100644 --- a/packages/codegen/schema.graphql +++ b/packages/codegen/schema.graphql @@ -358,6 +358,7 @@ enum AccountType_update_column { } type BoxProfile { + collectiblesFavorites: [CollectiblesFavorites!] coverImageUrl: String description: String emoji: String @@ -369,6 +370,11 @@ type BoxProfile { website: String } +type CollectiblesFavorites { + address: String + tokenId: String +} + """ columns and relationships of "EnneagramType" """