Skip to main content

Update Handbook Content

Update the HTML content of an existing handbook. This replaces the current content with the provided HTML string.

Mutation

mutation UpdateHandbookContent($handbookId: Int!, $content: String!, $handbookType: String) {
updateHandbookContent(handbookId: $handbookId, content: $content, handbookType: $handbookType) {
success
handbookId
handbookType
updatedAt
}
}

Parameters

ParameterTypeRequiredDescription
handbookIdInt!YesThe handbook ID to update
contentString!YesThe new HTML content for the handbook
handbookTypeStringNoHandbook type. Defaults to "comprehensive"

Response

{
"data": {
"updateHandbookContent": {
"success": true,
"handbookId": 123,
"handbookType": "comprehensive",
"updatedAt": "2025-03-15T10:30:00Z"
}
}
}

Examples

Basic Usage

mutation {
updateHandbookContent(
handbookId: 123
content: "<html><head><title>Employee Handbook</title></head><body><h1>Updated Handbook</h1><p>New content here...</p></body></html>"
) {
success
handbookId
updatedAt
}
}

With Variables

mutation UpdateContent($handbookId: Int!, $content: String!) {
updateHandbookContent(handbookId: $handbookId, content: $content) {
success
handbookId
handbookType
updatedAt
}
}

Variables:

{
"handbookId": 123,
"content": "<html><head><title>Employee Handbook</title></head><body><h1>Updated Handbook</h1><p>New content here...</p></body></html>"
}

Create Version Before Updating

It's recommended to create a version snapshot before updating content so you can roll back if needed:

mutation SnapshotAndUpdate($handbookId: Int!, $content: String!) {
createHandbookVersion(handbookId: $handbookId) {
id
versionNumber
}
updateHandbookContent(handbookId: $handbookId, content: $content) {
success
updatedAt
}
}

Error Responses

Handbook Not Found

{
"errors": [
{
"message": "Handbook not found or access denied"
}
]
}

Subscription Required

{
"errors": [
{
"message": "This operation requires an active subscription. ONE_TIME or unsubscribed handbooks are not supported."
}
]
}

Empty Content

{
"errors": [
{
"message": "Content cannot be empty"
}
]
}

Notes

  • Requires bearer token authentication
  • Requires an active subscription (SUBSCRIPTION status) — ONE_TIME or unsubscribed handbooks are not supported
  • User can only update handbooks belonging to their account
  • The content field expects a full HTML string
  • This operation replaces the entire handbook content — it does not merge or patch
  • Consider calling createHandbookVersion before updating to preserve the ability to roll back
  • Changes are reflected immediately on the shared handbook link (if sharing is enabled)