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

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 files.

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

Arguments

ArgumentTypeDescription
idUUID!Generation ID to delete

Returns

true if deletion was successful.

Example

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

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
}
}

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/