Quiltt Logo

Mutate a Profile's data

Mutations allow you to add, update or remove data pertaining to the authenticated user, such as their Profile, Connections or Accounts.

GraphQL natively supports performing multiple mutations in one request. Keep in mind that if you define multiple mutations in a single request, they will be executed sequentially in the order they're defined. This ensures that data from an earlier mutation is available to subsequent mutations.

Link to this section#Available Mutations

Below are some of the Mutations generally available via GraphQL:

  • accountUpdate: Update an Account's metadata.
  • connectionDisconnect: Disconnect a Connection.
  • connectionSimulateError: Put a Connection into a repairable error state.
  • connectionUpdate: Update an Connection's metadata.
  • profileUpdate: Update Profile information.
  • transactionUpdate: Update an Transaction's metadata.

Link to this section#Examples

Link to this section#profileUpdate Mutation

In this example, we will define a profile query to get the user's basic profile details:

Link to this section#Request

mutation {
  profileUpdate(input: { metadata: {firebaseId: "Xk3D12aB4zO7QW5z8s9Y"}}) {
    success
    record {
      id
      metadata
    }
  }
}

Link to this section#Response

In GraphQL, successful queries always return a data object that mirrors the structure of your request.

{
  "data": {
    "success": true,
    "profile": {
      "id": "p_11oaRngjEOLf1YcBdZqKp0E",
      "metadata": {
        "internalId": "abcdef"
      }
    },
    "errors": null
  }
}

Link to this section#Using Mutations with React

The Quiltt React SDK provides a built-in useMutation hook to call the Quiltt GraphQL API. Additionally, the GraphQL community provides a rich ecosystem of open-source clients and libraries that seamlessly plug-in to your client-side or server-side framework of choice.