Skip to main content

GraphQL Mutations

This page documents all available GraphQL mutations in the Boards API. Mutations are operations that create, update, or delete data.

Mutation Overview​

MutationDescriptionAuth Required
createBoardCreate a new boardYes
updateBoardUpdate an existing boardYes (owner/admin)
deleteBoardDelete a boardYes (owner)
addBoardMemberAdd a member to a boardYes (owner/admin)
removeBoardMemberRemove a member from a boardYes (owner/admin)
updateBoardMemberRoleChange a member's roleYes (owner/admin)
createGenerationStart a new generationYes
cancelGenerationCancel a pending generationYes
deleteGenerationDelete a generationYes
regenerateRe-run a generationYes
uploadArtifactUpload an artifact from URLYes
createTagCreate a new tagYes
updateTagUpdate an existing tagYes
deleteTagDelete a tagYes
addTagToGenerationAdd a tag to a generationYes (owner/editor)
removeTagFromGenerationRemove a tag from a generationYes (owner/editor)

Board Mutations​

createBoard​

Create a new board owned by the current user.

mutation {
createBoard(input: CreateBoardInput!): Board!
}

Input Type​

input CreateBoardInput {
title: String!
description: String
isPublic: Boolean = false
settings: JSON
}
FieldTypeDefaultDescription
titleString!-Board title (required)
descriptionStringnullOptional description
isPublicBooleanfalseWhether board is publicly visible
settingsJSONnullCustom board settings

Example​

mutation CreateMyBoard {
createBoard(input: {
title: "AI Art Gallery"
description: "My collection of AI-generated artwork"
isPublic: true
settings: {
theme: "dark",
gridColumns: 4
}
}) {
id
title
description
isPublic
settings
createdAt
}
}

updateBoard​

Update an existing board. Only the owner or admins can update a board.

mutation {
updateBoard(input: UpdateBoardInput!): Board!
}

Input Type​

input UpdateBoardInput {
id: UUID!
title: String
description: String
isPublic: Boolean
settings: JSON
}
FieldTypeDescription
idUUID!Board ID (required)
titleStringNew title
descriptionStringNew description
isPublicBooleanNew visibility
settingsJSONNew settings (merges with existing)

Example​

mutation UpdateMyBoard($boardId: UUID!) {
updateBoard(input: {
id: $boardId
title: "Updated Gallery Name"
isPublic: false
}) {
id
title
isPublic
updatedAt
}
}

deleteBoard​

Delete a board and all its generations. Only the owner can delete a board.

mutation {
deleteBoard(id: UUID!): Boolean!
}

Arguments​

ArgumentTypeDescription
idUUID!Board ID to delete

Returns​

true if deletion was successful.

Example​

mutation DeleteMyBoard($boardId: UUID!) {
deleteBoard(id: $boardId)
}
warning

This operation is destructive and cannot be undone. All generations in the board will also be deleted.


addBoardMember​

Add a user as a member of a board. Requires owner or admin role.

mutation {
addBoardMember(input: AddBoardMemberInput!): Board!
}

Input Type​

input AddBoardMemberInput {
boardId: UUID!
userId: UUID!
role: BoardRole = VIEWER
}
FieldTypeDefaultDescription
boardIdUUID!-Board to add member to
userIdUUID!-User to add
roleBoardRoleVIEWERRole to assign

Example​

mutation AddMember($boardId: UUID!, $userId: UUID!) {
addBoardMember(input: {
boardId: $boardId
userId: $userId
role: EDITOR
}) {
id
members {
user {
id
displayName
}
role
joinedAt
}
}
}

removeBoardMember​

Remove a member from a board. Requires owner or admin role.

mutation {
removeBoardMember(boardId: UUID!, userId: UUID!): Board!
}

Arguments​

ArgumentTypeDescription
boardIdUUID!Board ID
userIdUUID!User ID to remove

Example​

mutation RemoveMember($boardId: UUID!, $userId: UUID!) {
removeBoardMember(boardId: $boardId, userId: $userId) {
id
members {
user {
id
}
}
}
}

updateBoardMemberRole​

Change a board member's role. Requires owner or admin role.

mutation {
updateBoardMemberRole(
boardId: UUID!
userId: UUID!
role: BoardRole!
): Board!
}

Arguments​

ArgumentTypeDescription
boardIdUUID!Board ID
userIdUUID!User ID to update
roleBoardRole!New role

Example​

mutation PromoteToAdmin($boardId: UUID!, $userId: UUID!) {
updateBoardMemberRole(
boardId: $boardId
userId: $userId
role: ADMIN
) {
id
members {
user {
id
}
role
}
}
}

Generation Mutations​

createGeneration​

Start a new generation job. The generation runs asynchronously; use subscriptions or polling to track progress.

mutation {
createGeneration(input: CreateGenerationInput!): Generation!
}

Input Type​

input CreateGenerationInput {
boardId: UUID!
generatorName: String!
artifactType: ArtifactType!
inputParams: JSON!
}
FieldTypeDescription
boardIdUUID!Board to add the generation to
generatorNameString!Name of the generator to use
artifactTypeArtifactType!Type of artifact to generate
inputParamsJSON!Parameters for the generator (schema varies by generator)

Example​

mutation GenerateImage($boardId: UUID!) {
createGeneration(input: {
boardId: $boardId
generatorName: "flux-1-dev"
artifactType: IMAGE
inputParams: {
prompt: "A serene mountain landscape at sunset, digital art"
width: 1024
height: 768
num_inference_steps: 28
guidance_scale: 3.5
}
}) {
id
status
progress
generatorName
artifactType
createdAt
}
}

Lineage Tracking​

Input parameters that reference other generations (by ID) are automatically resolved and tracked as lineage. For example, for image-to-image generation:

mutation ImageToImage($boardId: UUID!, $sourceGenId: UUID!) {
createGeneration(input: {
boardId: $boardId
generatorName: "flux-1-dev-img2img"
artifactType: IMAGE
inputParams: {
image: $sourceGenId
prompt: "Transform to watercolor style"
strength: 0.75
}
}) {
id
inputArtifacts {
role
generation {
id
}
}
}
}

cancelGeneration​

Cancel a pending or processing generation.

mutation {
cancelGeneration(id: UUID!): Generation!
}

Arguments​

ArgumentTypeDescription
idUUID!Generation ID to cancel

Returns​

The generation with status updated to CANCELLED.

Example​

mutation CancelJob($genId: UUID!) {
cancelGeneration(id: $genId) {
id
status
}
}
note

Only generations with status PENDING or PROCESSING can be cancelled. Completed or failed generations cannot be cancelled.


deleteGeneration​

Delete a generation and its associated storage artifacts.

mutation {
deleteGeneration(id: UUID!): Boolean!
}

Arguments​

ArgumentTypeDescription
idUUID!Generation ID to delete

Returns​

true if deletion was successful.

Authorization​

Generation deletion requires authentication and follows these rules:

  • Board owner can delete any generation on their board
  • Board editors can only delete their own generations (ones they created)
  • Board viewers cannot delete any generations
  • Non-members cannot delete generations
Authorization Examples
# Owner deletes any generation on their board
mutation {
deleteGeneration(id: "gen-uuid") # ✅ Allowed
}

# Editor deletes their own generation
mutation {
deleteGeneration(id: "gen-created-by-editor") # ✅ Allowed
}

# Editor tries to delete owner's generation
mutation {
deleteGeneration(id: "gen-created-by-owner") # ❌ Permission denied
}

# Viewer tries to delete a generation
mutation {
deleteGeneration(id: "gen-uuid") # ❌ Permission denied
}

Example​

mutation DeleteGeneration($genId: UUID!) {
deleteGeneration(id: $genId)
}
warning

This operation is destructive and cannot be undone. The generation record and associated storage artifacts will be permanently deleted.


regenerate​

Create a new generation using the same parameters as an existing one.

mutation {
regenerate(id: UUID!): Generation!
}

Arguments​

ArgumentTypeDescription
idUUID!Generation ID to regenerate from

Returns​

A new Generation with the same parameters but a new ID.

Example​

mutation RegenerateImage($genId: UUID!) {
regenerate(id: $genId) {
id
status
generatorName
inputParams
}
}

uploadArtifact​

Upload an artifact from an external URL. This creates a generation record for an externally-created asset.

mutation {
uploadArtifact(input: UploadArtifactInput!): Generation!
}

Input Type​

input UploadArtifactInput {
boardId: UUID!
artifactType: ArtifactType!
fileUrl: String
originalFilename: String
userDescription: String
parentGenerationId: UUID
}
FieldTypeDescription
boardIdUUID!Board to add the artifact to
artifactTypeArtifactType!Type of the artifact
fileUrlStringURL to fetch the file from
originalFilenameStringOriginal filename
userDescriptionStringUser-provided description
parentGenerationIdUUIDOptional parent generation for lineage

Example​

mutation UploadImage($boardId: UUID!) {
uploadArtifact(input: {
boardId: $boardId
artifactType: IMAGE
fileUrl: "https://example.com/my-image.png"
originalFilename: "my-image.png"
userDescription: "Reference image for style transfer"
}) {
id
status
storageUrl
thumbnailUrl
}
}

Tag Mutations​

createTag​

Create a new tag for the current tenant. If no slug is provided, one is auto-generated from the tag name.

mutation {
createTag(input: CreateTagInput!): Tag!
}

Input Type​

input CreateTagInput {
name: String!
slug: String
description: String
metadata: JSON
}
FieldTypeDefaultDescription
nameString!-Tag display name (required)
slugStringAuto-generatedURL-friendly identifier (must be unique per tenant)
descriptionStringnullOptional description
metadataJSONnullAdditional metadata

Example​

mutation CreateTag {
createTag(input: {
name: "Favorite"
description: "My favorite generations"
}) {
id
name
slug
description
createdAt
}
}

updateTag​

Update an existing tag. Only provided fields are updated.

mutation {
updateTag(input: UpdateTagInput!): Tag!
}

Input Type​

input UpdateTagInput {
id: UUID!
name: String
slug: String
description: String
metadata: JSON
}
FieldTypeDescription
idUUID!Tag ID (required)
nameStringNew display name
slugStringNew slug (must be unique per tenant)
descriptionStringNew description
metadataJSONNew metadata

Example​

mutation UpdateTag($tagId: UUID!) {
updateTag(input: {
id: $tagId
name: "Top Picks"
description: "My top picks from all generations"
}) {
id
name
slug
description
updatedAt
}
}

deleteTag​

Delete a tag. This also removes all associations between the tag and any generations.

mutation {
deleteTag(id: UUID!): Boolean!
}

Arguments​

ArgumentTypeDescription
idUUID!Tag ID to delete

Returns​

true if deletion was successful.

Example​

mutation DeleteTag($tagId: UUID!) {
deleteTag(id: $tagId)
}
warning

This operation is destructive and cannot be undone. The tag will be removed from all generations it was associated with.


addTagToGeneration​

Add a tag to a generation. Requires owner or editor role on the generation's board.

mutation {
addTagToGeneration(generationId: UUID!, tagId: UUID!): Tag!
}

Arguments​

ArgumentTypeDescription
generationIdUUID!The generation to tag
tagIdUUID!The tag to add

Returns​

The Tag that was added.

Example​

mutation TagGeneration($genId: UUID!, $tagId: UUID!) {
addTagToGeneration(generationId: $genId, tagId: $tagId) {
id
name
slug
}
}

removeTagFromGeneration​

Remove a tag from a generation. Requires owner or editor role on the generation's board.

mutation {
removeTagFromGeneration(generationId: UUID!, tagId: UUID!): Boolean!
}

Arguments​

ArgumentTypeDescription
generationIdUUID!The generation to untag
tagIdUUID!The tag to remove

Returns​

true if the tag was successfully removed.

Example​

mutation UntagGeneration($genId: UUID!, $tagId: UUID!) {
removeTagFromGeneration(generationId: $genId, tagId: $tagId)
}

Error Handling​

Mutations return errors in the standard GraphQL format:

{
"data": {
"createBoard": null
},
"errors": [
{
"message": "Not authenticated",
"path": ["createBoard"],
"extensions": {
"code": "UNAUTHENTICATED"
}
}
]
}

Common Errors​

CodeDescription
UNAUTHENTICATEDNo valid authentication token
FORBIDDENUser lacks permission for this operation
NOT_FOUNDReferenced resource doesn't exist
BAD_USER_INPUTInvalid input parameters

Source Files​

Mutation definitions are implemented in:

  • packages/backend/src/boards/graphql/mutations/root.py
  • packages/backend/src/boards/graphql/resolvers/