Skip to main content

GraphQL Queries

This page documents all available GraphQL queries in the Boards API. Queries are read-only operations for fetching data.

Query Overview

QueryDescriptionAuth Required
meGet current authenticated userYes
userGet user by IDYes
boardGet board by IDDepends*
myBoardsGet boards owned by or shared with current userYes
publicBoardsGet public boardsNo
searchBoardsSearch boards by title/descriptionYes
generationGet generation by IDDepends*
recentGenerationsGet recent generations with filtersYes
generatorsGet available generatorsNo

*Depends on board visibility (public boards accessible without auth)


User Queries

me

Get the currently authenticated user.

query {
me: User
}

Returns

User or null if not authenticated.

Example

query GetCurrentUser {
me {
id
email
displayName
avatarUrl
createdAt
}
}

Response

{
"data": {
"me": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"displayName": "John Doe",
"avatarUrl": "https://example.com/avatar.jpg",
"createdAt": "2024-01-15T10:30:00Z"
}
}
}

user

Get a user by their ID.

query {
user(id: UUID!): User
}

Arguments

ArgumentTypeDescription
idUUID!The user's unique identifier

Returns

User or null if not found.

Example

query GetUser($userId: UUID!) {
user(id: $userId) {
id
displayName
avatarUrl
boards {
id
title
isPublic
}
}
}

Board Queries

board

Get a single board by ID. Returns the board if it's public or if the authenticated user has access.

query {
board(id: UUID!): Board
}

Arguments

ArgumentTypeDescription
idUUID!The board's unique identifier

Returns

Board or null if not found or not accessible.

Example

query GetBoard($boardId: UUID!) {
board(id: $boardId) {
id
title
description
isPublic
createdAt
updatedAt
owner {
id
displayName
}
members {
user {
displayName
}
role
joinedAt
}
generationCount
generations(limit: 20) {
id
thumbnailUrl
artifactType
status
createdAt
}
}
}

myBoards

Get boards owned by or shared with the current authenticated user.

query {
myBoards(
limit: Int = 50
offset: Int = 0
role: BoardQueryRole
sort: SortOrder
): [Board!]!
}

Arguments

ArgumentTypeDefaultDescription
limitInt50Maximum number of boards to return
offsetInt0Number of boards to skip
roleBoardQueryRoleANYFilter by user's role
sortSortOrderUPDATED_DESCSort order

Enums

BoardQueryRole:

ValueDescription
ANYAll accessible boards
OWNEROnly boards user owns
MEMBEROnly boards where user is a member (not owner)

SortOrder:

ValueDescription
CREATED_ASCOldest first
CREATED_DESCNewest first
UPDATED_ASCLeast recently updated first
UPDATED_DESCMost recently updated first

Example

query GetMyBoards {
myBoards(limit: 10, role: OWNER, sort: UPDATED_DESC) {
id
title
description
isPublic
updatedAt
generationCount
}
}

publicBoards

Get publicly visible boards.

query {
publicBoards(
limit: Int = 50
offset: Int = 0
sort: SortOrder
): [Board!]!
}

Arguments

ArgumentTypeDefaultDescription
limitInt50Maximum number of boards to return
offsetInt0Number of boards to skip
sortSortOrderUPDATED_DESCSort order

Example

query GetPublicBoards {
publicBoards(limit: 20, sort: CREATED_DESC) {
id
title
description
owner {
displayName
}
generationCount
createdAt
}
}

searchBoards

Search for boards by title or description. Only returns boards accessible to the current user.

query {
searchBoards(
query: String!
limit: Int = 50
offset: Int = 0
): [Board!]!
}

Arguments

ArgumentTypeDefaultDescription
queryString!-Search query string
limitInt50Maximum number of boards to return
offsetInt0Number of boards to skip

Example

query SearchBoards($searchQuery: String!) {
searchBoards(query: $searchQuery, limit: 10) {
id
title
description
isPublic
owner {
displayName
}
}
}

Generation Queries

generation

Get a single generation by ID.

query {
generation(id: UUID!): Generation
}

Arguments

ArgumentTypeDescription
idUUID!The generation's unique identifier

Returns

Generation or null if not found or not accessible.

Example

query GetGeneration($genId: UUID!) {
generation(id: $genId) {
id
generatorName
artifactType
status
progress
errorMessage
storageUrl
thumbnailUrl
inputParams
outputMetadata
createdAt
startedAt
completedAt
user {
displayName
}
board {
id
title
}
inputArtifacts {
role
artifactType
generation {
id
thumbnailUrl
}
}
}
}

recentGenerations

Get recent generations with optional filters.

query {
recentGenerations(
boardId: UUID
status: GenerationStatus
artifactType: ArtifactType
limit: Int = 50
offset: Int = 0
): [Generation!]!
}

Arguments

ArgumentTypeDefaultDescription
boardIdUUID-Filter by board
statusGenerationStatus-Filter by status
artifactTypeArtifactType-Filter by artifact type
limitInt50Maximum number to return
offsetInt0Number to skip

Example

query GetRecentImages($boardId: UUID!) {
recentGenerations(
boardId: $boardId
artifactType: IMAGE
status: COMPLETED
limit: 20
) {
id
generatorName
storageUrl
thumbnailUrl
inputParams
createdAt
}
}

Generator Queries

generators

Get all available generators, optionally filtered by artifact type.

query {
generators(artifactType: String): [GeneratorInfo!]!
}

Arguments

ArgumentTypeDescription
artifactTypeStringFilter by artifact type (e.g., "image", "video")

Example

query GetImageGenerators {
generators(artifactType: "image") {
name
description
artifactType
inputSchema
}
}

Response

{
"data": {
"generators": [
{
"name": "flux-1-dev",
"description": "FLUX.1 Dev - High quality image generation",
"artifactType": "IMAGE",
"inputSchema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "Text prompt for image generation"
},
"width": {
"type": "integer",
"default": 1024
},
"height": {
"type": "integer",
"default": 1024
}
},
"required": ["prompt"]
}
}
]
}
}

Pagination

All list queries support pagination via limit and offset arguments:

query PaginatedBoards($page: Int!) {
myBoards(limit: 10, offset: $page * 10) {
id
title
}
}

For large datasets, consider using cursor-based pagination patterns in your application layer.


Error Handling

Queries return null for single-item queries when:

  • The resource doesn't exist
  • The user doesn't have permission to access it

List queries return empty arrays when no results match.

Authentication errors are returned in the errors array:

{
"data": {
"myBoards": null
},
"errors": [
{
"message": "Not authenticated",
"path": ["myBoards"]
}
]
}

Source Files

Query definitions are implemented in:

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