Get bookmarks
Full code example
This request is protected by authentication
hint: this means it requires an x-access-token header put in the request with your authentication token.
This query returns a list of bookmarked publications.
API Design
query PublicationsProfileBookmarks {
publicationsProfileBookmarks(request: {
profileId: "0x03"
limit: 10
}) {
items {
__typename
... on Post {
...PostFields
}
... on Comment {
...CommentFields
}
... on Mirror {
...MirrorFields
}
}
pageInfo {
prev
next
totalCount
}
}
}
fragment MediaFields on Media {
url
width
height
mimeType
}
fragment ProfileFields on Profile {
id
name
bio
attributes {
displayType
traitType
key
value
}
isFollowedByMe
isFollowing(who: null)
followNftAddress
metadata
isDefault
handle
picture {
... on NftImage {
contractAddress
tokenId
uri
verified
}
... on MediaSet {
original {
...MediaFields
}
small {
...MediaFields
}
medium {
...MediaFields
}
}
}
coverPicture {
... on NftImage {
contractAddress
tokenId
uri
verified
}
... on MediaSet {
original {
...MediaFields
}
small {
...MediaFields
}
medium {
...MediaFields
}
}
}
ownedBy
dispatcher {
address
}
stats {
totalFollowers
totalFollowing
totalPosts
totalComments
totalMirrors
totalPublications
totalCollects
}
followModule {
...FollowModuleFields
}
}
fragment PublicationStatsFields on PublicationStats {
totalAmountOfMirrors
totalAmountOfCollects
totalAmountOfComments
}
fragment MetadataOutputFields on MetadataOutput {
name
description
content
media {
original {
...MediaFields
}
small {
...MediaFields
}
medium {
...MediaFields
}
}
attributes {
displayType
traitType
value
}
}
fragment Erc20Fields on Erc20 {
name
symbol
decimals
address
}
fragment PostFields on Post {
id
profile {
...ProfileFields
}
stats {
...PublicationStatsFields
}
metadata {
...MetadataOutputFields
}
createdAt
collectModule {
...CollectModuleFields
}
referenceModule {
...ReferenceModuleFields
}
appId
hidden
reaction(request: null)
mirrors(by: null)
hasCollectedByMe
}
fragment MirrorBaseFields on Mirror {
id
profile {
...ProfileFields
}
stats {
...PublicationStatsFields
}
metadata {
...MetadataOutputFields
}
createdAt
collectModule {
...CollectModuleFields
}
referenceModule {
...ReferenceModuleFields
}
appId
hidden
reaction(request: null)
hasCollectedByMe
}
fragment MirrorFields on Mirror {
...MirrorBaseFields
mirrorOf {
... on Post {
...PostFields
}
... on Comment {
...CommentFields
}
}
}
fragment CommentBaseFields on Comment {
id
profile {
...ProfileFields
}
stats {
...PublicationStatsFields
}
metadata {
...MetadataOutputFields
}
createdAt
collectModule {
...CollectModuleFields
}
referenceModule {
...ReferenceModuleFields
}
appId
hidden
reaction(request: null)
mirrors(by: null)
hasCollectedByMe
}
fragment CommentFields on Comment {
...CommentBaseFields
mainPost {
... on Post {
...PostFields
}
... on Mirror {
...MirrorBaseFields
mirrorOf {
... on Post {
...PostFields
}
... on Comment {
...CommentMirrorOfFields
}
}
}
}
}
fragment CommentMirrorOfFields on Comment {
...CommentBaseFields
mainPost {
... on Post {
...PostFields
}
... on Mirror {
...MirrorBaseFields
}
}
}
fragment FollowModuleFields on FollowModule {
... on FeeFollowModuleSettings {
type
amount {
asset {
name
symbol
decimals
address
}
value
}
recipient
}
... on ProfileFollowModuleSettings {
type
contractAddress
}
... on RevertFollowModuleSettings {
type
contractAddress
}
... on UnknownFollowModuleSettings {
type
contractAddress
followModuleReturnData
}
}
fragment CollectModuleFields on CollectModule {
__typename
... on FreeCollectModuleSettings {
type
followerOnly
contractAddress
}
... on FeeCollectModuleSettings {
type
amount {
asset {
...Erc20Fields
}
value
}
recipient
referralFee
}
... on LimitedFeeCollectModuleSettings {
type
collectLimit
amount {
asset {
...Erc20Fields
}
value
}
recipient
referralFee
}
... on LimitedTimedFeeCollectModuleSettings {
type
collectLimit
amount {
asset {
...Erc20Fields
}
value
}
recipient
referralFee
endTimestamp
}
... on RevertCollectModuleSettings {
type
}
... on TimedFeeCollectModuleSettings {
type
amount {
asset {
...Erc20Fields
}
value
}
recipient
referralFee
endTimestamp
}
... on UnknownCollectModuleSettings {
type
contractAddress
collectModuleReturnData
}
}
fragment ReferenceModuleFields on ReferenceModule {
... on FollowOnlyReferenceModuleSettings {
type
contractAddress
}
... on UnknownReferenceModuleSettings {
type
contractAddress
referenceModuleReturnData
}
... on DegreesOfSeparationReferenceModuleSettings {
type
contractAddress
commentsRestricted
mirrorsRestricted
degreesOfSeparation
}
}
{
"data": {
"publicationsProfileBookmarks": {
"items": [
{
"__typename": "Post",
"id": "0x03b0-0x01",
"profile": {
"id": "0x03b0",
"name": null,
"bio": null,
"attributes": [],
"isFollowedByMe": false,
"isFollowing": false,
"followNftAddress": null,
"metadata": null,
"isDefault": true,
"handle": "jojay",
"picture": {
"original": {
"url": "https://ipfs.infura.io/ipfs/QmcKD5Zxic7JAum22jKRnT3ENY4tCCp7qQSPJTCLkHAApm",
"width": null,
"height": null,
"mimeType": null
},
"small": null,
"medium": null
},
"coverPicture": null,
"ownedBy": "0x0c0E611A29b339D8c1048F2Edf9d4160A5fb8F22",
"dispatcher": null,
"stats": {
"totalFollowers": 1,
"totalFollowing": 4,
"totalPosts": 1,
"totalComments": 0,
"totalMirrors": 0,
"totalPublications": 1,
"totalCollects": 0
},
"followModule": {
"type": "FeeFollowModule",
"amount": {
"asset": {
"name": "Wrapped Matic",
"symbol": "WMATIC",
"decimals": 18,
"address": "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889"
},
"value": "10.0"
},
"recipient": "0x0c0E611A29b339D8c1048F2Edf9d4160A5fb8F22"
}
},
"stats": {
"totalAmountOfMirrors": 0,
"totalAmountOfCollects": 0,
"totalAmountOfComments": 3
},
"metadata": {
"name": "Post by @jojay",
"description": "Hello Josh :)",
"content": "Hello Josh :)",
"media": [],
"attributes": [
{
"displayType": null,
"traitType": "type",
"value": "post"
}
]
},
"createdAt": "2022-04-16T08:33:25.000Z",
"collectModule": {
"__typename": "RevertCollectModuleSettings",
"type": "RevertCollectModule"
},
"referenceModule": null,
"appId": "Lenster",
"hidden": false,
"reaction": null,
"mirrors": [],
"hasCollectedByMe": false
},
{
"__typename": "Post",
"id": "0x0f-0xa0",
"profile": {
"id": "0x0f",
"name": null,
"bio": null,
"attributes": [],
"followNftAddress": "0x8A8bd1E37b099aE3386D13947b6a90d97675e9a1"
"metadata": null,
"isDefault": true,
"handle": "wagmi.lens",
"picture": {
"original": {
"url": "https://ipfs.infura.io/ipfs/Qma8mXoeorvPqodDazf7xqARoFD394s1njkze7q1X4CK8U",
"width": null,
"height": null,
"mimeType": null
},
"small": null,
"medium": null
},
"coverPicture": null,
"ownedBy": "0x3A5bd1E37b099aE3386D13947b6a90d97675e5e3",
"dispatcher": null,
"stats": {
"totalFollowers": 111,
"totalFollowing": 15,
"totalPosts": 89,
"totalComments": 64,
"totalMirrors": 15,
"totalPublications": 168,
"totalCollects": 215
},
"followModule": null
},
"stats": {
"totalAmountOfMirrors": 0,
"totalAmountOfCollects": 0,
"totalAmountOfComments": 6
},
"metadata": {
"name": "Post by @yoginth",
"description": "Testing hashflags\n\n#lenster #Lenster #LENSTER #lens #ethereum #Bitcoin",
"content": "Testing hashflags\n\n#lenster #Lenster #LENSTER #lens #ethereum #Bitcoin",
"media": [],
"attributes": [
{
"displayType": null,
"traitType": "string",
"value": "post"
}
]
},
"createdAt": "2022-04-20T06:26:56.000Z",
"collectModule": {
"__typename": "RevertCollectModuleSettings",
"type": "RevertCollectModule"
},
"referenceModule": null,
"appId": "Lenster",
"hidden": false,
"reaction": null,
"mirrors": [],
"hasCollectedByMe": false
}
],
"pageInfo": {
"prev": "{\"timestamp\":1649942608500,\"offset\":0,\"randomizer\":5}",
"next": "{\"timestamp\":1649942608500,\"offset\":10,\"randomizer\":5}",
"totalCount": 2
}
}
}
}
You will see the paging result behavior repeated a lot in the API, this is to allow you to fetch a certain amount and then page it for the most optimal request speed. Every time something is wrapped in a paging result you will always get returned a pageInfo
which holds the cursors for the previous and next alongside the total count which exists in the database. These cursors are just pointers for the server to get to the next result and do not need to be understood by your client or server. If you ever want to then page to the next result you can pass these previous and next cursor in the request cursor property.
Updated 3 months ago