updateProfile

This operation updates the profile with user provided data

🔑 Requires authentication

This operation requires Bearer Token issued from our Authentication flow appended to the request headers. Please refer to Authentication page.

Interface

GraphQL Schema
input ProfileData {
  location: String
  name: String
  bio: String
  twitter: String
  coverPicture: String
  statusEmoji: String
  statusText: String
  profilePicture: String
}

input ProfileEditInput {
  profileId: String!
  data: ProfileData!
}

type Mutation {
  updateProfile(input: ProfileEditInput!): Profile!
}

Request Inputs:

  1. profileId: [Required] Profile to update

  2. data: [Required] Data to update

    • All fields are optional

    • To update a field, provide the attribute key-value pair

    • To remove an existing field, provide the attribute key-value pair, with an "" empty string as the value

    • If an existing field exists and there are no changes to be made, omit the key from data payload

Operation

GraphQL Operation
# In this operation, we are updating profilePicture for profileId '0x13'
mutation UpdateProfile {
  updateProfile(
    input: {
      profileId: "0x13",
      data: {
        profilePicture: "https://m.media-amazon.com/images/I/71NVb6VfiyL._UC256,256_CACC,256,256_.jpg"
      }
    }
  ) {
    id
    profileId
    handle
    ownedBy
    metadataUrl
    metadataS3Url
  }
}

# In this operation, we are removing coverPicture and updating name for profileId '0x13'
mutation UpdateProfile {
  updateProfile(
    input: {
      profileId: "0x13",
      data: {
        name: "Uncle Bob 💁🏼‍♂️",
        coverPicture: ""
      }
    }
  ) {
    id
    profileId
    handle
    ownedBy
    metadataUrl
    metadataS3Url
    # any other Profile fields
  }
}

Response

JSON Response
{
  "data": {
    "updateProfile": {
      "id": "53",
      "profileId": "0x13",
      "handle": "FamilyGuy",
      "ownedBy": "0QDfUGBCDft-IaGQ1YL5ywR3V4pno1xCbvzFpcvdouIhPRVY",
      "metadataUrl": "https://nabi-protocol-profile-nft-meta.s3.amazonaws.com/e368f4a5-f054-40f2-aad1-22be2fb9ff99.json",
      "metadataS3Url": "https://nabi-protocol-profile-nft-meta.s3.amazonaws.com/e368f4a5-f054-40f2-aad1-22be2fb9ff99.json"
      // ... other Profile fields
    }
  }
}

Last updated