Field Option Mutations
The Field Option API provides mutations to manage options for SELECTION and SELECTION_MULTI fields.
Update Field Option
Update an existing field option.
Mutation Structure
mutation UpdateFieldOption(
$id: String!
$color: String
$name: String
$postId: String
$postVisibility: PostVisibility
) {
updateFieldOption(
id: $id
color: $color
name: $name
postId: $postId
postVisibility: $postVisibility
) {
node {
id
color
name
postVisibility
}
}
}
Input Fields
| Field | Type | Description |
|---|---|---|
id | String! | ID of the field option to update |
color | String | New color code for the option |
name | String | New display name for the option |
postId | String | Optional post ID for option updates in post context |
postVisibility | PostVisibility | New visibility setting for posts with this option |
Delete Field Option
Delete an existing field option.
Mutation Structure
mutation DeleteFieldOption($id: String!, $postId: String) {
deleteFieldOption(id: $id, postId: $postId) {
node {
id
}
}
}
Input Fields
| Field | Type | Description |
|---|---|---|
id | String! | ID of the field option to delete |
postId | String | Optional post ID for option deletion in post context |
Error Handling
Authentication Errors
- Invalid API Key: Returned when the API key is missing or invalid
- Insufficient Permissions: Returned when the user lacks write access to the board
- Write Access Required: Returned when using a read-only API key
Example Error Response
{
"errors": [
{
"message": "Invalid color format. Must be a valid hex color code",
"extensions": {
"code": "INVALID_INPUT",
"field": "color"
}
}
]
}
Notes
- Field options are typically managed through the parent field's mutations (
createFieldandupdateField). - The standalone mutations above are used for individual option updates and deletions.
- When a field option is deleted:
- It is removed from the parent field's options list
- Any posts using this option will have it removed from their values
- The
postIdparameter is used when updating/deleting options in the context of a specific post to ensure proper handling of post-specific data.