NOTE: Parenthesis is required only if the operation takes an optional variables object.
TIP: You can find ID's for any entity within the Linear app by searching for for "Copy model UUID" in the command menu.
Mutations
To create a model, call the Linear Client mutation and pass in the input object:
const teams = await linearClient.teams();
const team = teams.nodes[0];
if (team.id) {
await linearClient.createIssue({ teamId: team.id, title: "My Created Issue" });
}
To update a model, call the Linear Client mutation and pass in the required variables and input object:
const me = await linearClient.viewer;
if (me.id) {
await linearClient.updateUser(me.id, { displayName: "Alice" });
}
Or call the mutation from the model:
const me = await linearClient.viewer;
await me.update({ displayName: "Alice" });