getMirror

Similar to Posts, Mirrors only consist of mirrorId after the Mirror smart contract is deployed. Hence we provide 2 queries for you to fetch a Mirror.

Interface

GraphQL Schema
type Query {
  mirror(mirrorId: String!): Mirror
  mirrorById(id: String!): Mirror
}

Operation

GraphQL Operation
query QueryMirror {
  mirror(mirrorId: "0x20-0x01") {
    id
    mirrorId
    profileId
    content
    profile {
      handle
      metadataS3Url
    }
    post {
      postId
      id
      contentS3Uri
      profileId
      profile {
        handle
        metadataS3Url
        # ... any other Profile fields
      }
      stats {
        totalComments
        totalMirrors
        totalCollects
      }
      # ... any other Post fields
    }
    # ... any other Mirror fields
  }
}

Response

JSON Response
{
  "data": {
    "mirror": {
      "__typename": "Mirror",
      "id": "58",
      "mirrorId": "0x20-0x01",
      "profileId": "0x20",
      "content": "Yes this!!!!",
      "profile": {
        "handle": "LunarLily",
        "metadataS3Url": "https://nabi-protocol-profile-nft-meta.s3.amazonaws.com/5162af7f-5aa8-475c-91a1-d4b5690a268b.json"
      },
      "post": {
        "postId": "0x2-0x1a",
        "id": "43",
        "contentS3Uri": "https://nabi-protocol-profile-nft-meta.s3.amazonaws.com/fe6daf44-eb22-47ae-87e7-fa6bc0d10ebe.json"
        "profileId": "0x2"
        "profile": {
          "handle": "uNcleRaymOnd",
          "metadataS3Url": "https://nabi-protocol-profile-nft-meta.s3.amazonaws.com/c33d452d-704d-447d-9833-a4632dfa796d.json"
        },
        "stats": {
          "totalComments": 3,
          "totalMirrors": 2,
          "totalCollects": 0
        }
      },
    }
  }
}

Last updated