Guides

Has not interested publication

You need to know if a user has not interested a certain publication, to do this you need to look at the notInterested property on the publication response.

In this field resolver you can pass in a profileId you wish to know the not interested state for, most apps would use the logged in users selected profile they are browsing on.

API design basic

Please note the example below doesn't pick all the content out of the publication it just shows you the field used to get that back.

query Publications {
  publications(request: {
    profileId: "0x09",
    publicationTypes: [POST, COMMENT, MIRROR],
    limit: 10,
  }) {
    items {
      __typename 
      ... on Post {
        notInterested(by: "0x01")
      }
      ... on Comment {
        notInterested(by: "0x01")
      }
      ... on Mirror {
        notInterested(by: "0x01")
      }
    }
    pageInfo {
      prev
      next
      totalCount
    }
  }
}

profileId for notInterested can pass in as a variable easily enough as well. You can imagine passing the logged-in user's profile they are browsing on to see if they have mark publication as not interested. This can be hooked in like this for every query which returns a publication type (Post or Comment or Mirror)

query Publications($publicationsRequest: PublicationsQueryRequest!, $profileId: ProfileId) {
  publications(request: $publicationsRequest) {
    items {
      __typename 
      ... on Post {
        notInterested(by: $profileId)
      }
      ... on Comment {
        notInterested(by: $profileId)
      }
      ... on Mirror {
        notInterested(by: $profileId)
      }
    }
    pageInfo {
      prev
      next
      totalCount
    }
  }
}

Or, for a specific publication:

query Publication {
  publication(request: {
    publicationId: "0x01-0x01"
  }) {
   __typename 
    ... on Post {
      notInterested(by: "0x01")
    }
  }
}