Guides

Is Following Me ?

it's a common use-case to want to know whether a profile is following the currently logged in profile.

This is useful for displaying the correct UI, validating which actions the profile can take, etc.

There is not a specific query to get this information, you can leverage the data available on the Profile object (which is available in every method that returns profile data) to find the value.

You can find the boolean value in the isFollowingMe property on the Profile object.

ℹ️

isFollowingMe will default to false if this method is invoked without authentication (e.g. not logged in)

Request

  • forProfileId: string (required)
    • The identifier of the profile to check is following the authenticated profile.

Invocation

const { isFollowingMe } = await lensClient.profile.fetch({
  forProfileId: "PROFILE_ID",
});
query Profile {
  profile(request: { forProfileId: "PROFILE_ID" }) {
    # other profile fields are available
    isFollowingMe {
      value
      isFinalizedOnchain
    }
  }
}

Response

{
  // ...other profile fields are available
  "isFollowingMe": true
}

Full GraphQL API Example

📘

Is Following Me: GraphQL API Full Example