Skip to content

Commit

Permalink
fix: temp fixed the explore profile API
Browse files Browse the repository at this point in the history
  • Loading branch information
suhailkakar committed Jul 31, 2022
1 parent 808f762 commit 538e963
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 6 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"types": "dist/index.d.ts",
"scripts": {
"prepare": "npm run build",
"build": "tsc"
"build": "tsc",
"dev": "tsc --watch"
},
"repository": {
"type": "git",
Expand Down
99 changes: 94 additions & 5 deletions queries/explore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,102 @@ const ExplorePublications = async (
};

const ExploreProfiles = async (sortCriteria: any): Promise<object> => {
let query = `
query ExploreProfiles {
exploreProfiles(request: { sortCriteria: ${sortCriteria} }) {
items {
id
name
bio
isDefault
attributes {
displayType
traitType
key
value
}
followNftAddress
metadata
handle
picture {
... on NftImage {
contractAddress
tokenId
uri
chainId
verified
}
... on MediaSet {
original {
url
mimeType
}
}
}
coverPicture {
... on NftImage {
contractAddress
tokenId
uri
chainId
verified
}
... on MediaSet {
original {
url
mimeType
}
}
}
ownedBy
dispatcher {
address
canUseRelay
}
stats {
totalFollowers
totalFollowing
totalPosts
totalComments
totalMirrors
totalPublications
totalCollects
}
followModule {
... on FeeFollowModuleSettings {
type
contractAddress
amount {
asset {
name
symbol
decimals
address
}
value
}
recipient
}
... on ProfileFollowModuleSettings {
type
}
... on RevertFollowModuleSettings {
type
}
}
}
pageInfo {
prev
next
totalCount
}
}
}
`;

return new Promise((resolve, reject) => {
client
.query(EXPLORE_PROFILES, {
request: {
sortCriteria,
},
})
.query(query)
.toPromise()
.then((data) => {
resolve(data);
Expand Down

0 comments on commit 538e963

Please sign in to comment.