Create, update, or delete KPVs for your institution

The modifyKpvs mutation allows you to create new KPVs or update existing KPVs.

The mutation accepts a single kpvs argument, which should be an array of KpvInput objects.

mutation {  
  modifyKpvs(  
    kpvs: # [KpvInput] Array of KpvInput objects  
  )  
}

KpvInput

The KpvInput object contains all the attributes for the KPV you want to create or update. If you provide a uuid for an existing KPV at your institution, it will be updated with the attributes provided. However, if you provide a new uuid, a new record will be created with the attributes provided.

mutation {
  modifyKpvs(
    kpvs: [
      {
        uuid: "cfc559be-a810-40b7-9ba1-d5240e88db81", # New UUID creates a new record
        #...
      },
      {
        uuid: "cfc559be-a810-40b7-9ba1-d5240e88db81", # Existing UUID updates an existing record
        #...
      }
    ]
  )
}

athleteFacing [Boolean]

The athleteFacing attribute designates whether or not athletes can view their performance history for the KPV from their individual account (defaults to false).

description [String]

The description attribute allows you to provide instructions or notes about the KPV for athletes and coaches.

delete [Boolean]

The delete attribute allows you to flag a KPV for deletion (only applicable for existing KPVs). Note that deletion happens asynchronously, so it may take a few seconds for the delete operations to actually occur.

name* [String]

The name attribute is the name of the KPV, e.g. "Right Shoulder ROM."

unit [String]

The unit attribute is the unit of measurement. It is not required, and it can be a string of any value that describes the measurement of your KPV.

uuid* [String]

The uuid attribute is the KPV's unique identifier. It must conform to the standard UUID string format.

Sample Mutation

Putting it all together, a sample mutation might look something like the following:

mutation {
  modifyKpvs(
    kpvs: [
      {
        uuid: "bc7ec5fe-8508-4c11-bbd1-29be86a1f77e",
        name: "Stress",
        description: "Subjective self-assessment of today's stress level"
      },
      {
        uuid: "8ec74779-49ed-431c-a3eb-9271a4f22336",
        name: "Sleep Quality",
        description: "Subjective self-assessment of previous night's sleep quality."
      }
    ]
  ) {
    kpvs {
      persisted,
      uuid
    }
  }
}

This would return a JSON response like the following:

{
  "data": {
    "modifyKpvs": {
      "kpvs": [
        {
          "persisted": true,
          "uuid": "bc7ec5fe-8508-4c11-bbd1-29be86a1f77e"
        },
        {
          "persisted": true,
          "uuid": "8ec74779-49ed-431c-a3eb-9271a4f22336"
        }
      ]
    }
  }
}

* indicates required attribute