Skip to content

Characters

Last Updated   April 28, 2025

Reference

What is a Character?

Characters are fictional individuals that appear in books. The characters schema in Hardcover allows you to track and explore characters across different books, including information about their attributes, the books they appear in, and their creators.

Character Schema

The character schema contains the following fields:

Fields

FieldTypeDescription
idIntThe unique identifier of the character
nameStringThe name of the character
biographyStringA text description of the character’s background and story
created_atDateTimeThe timestamp when the character was created in the system
updated_atDateTimeThe timestamp when the character was last updated
gender_idIntReference to the character’s gender
has_disabilityBooleanIndicates if the character has a disability
is_lgbtqBooleanIndicates if the character identifies as LGBTQ+
is_pocBooleanIndicates if the character is a person of color
image_idStringReference to an image associated with the character
slugStringURL-friendly version of the character’s name
stateStringThe current state of the character record (e.g., “active”)
object_typeStringThe type of object, typically “Character”
user_idStringThe ID of the user who created or owns this character record

Example Queries

Get a Character by ID

Example query
query {
characters(where: {id: {_eq: "1"}}, limit: 1) {
id,
name
}
}

Get a Character by Name

Example query
query {
characters(where: {name: {_eq: "Harry Potter"}}) {
biography
slug
state
name
}
}

Get all Characters

Example query
query {
characters(limit: 10) {
id,
name
}
}

Get Books featuring a Character

Example query
query GetCharacterBooks {
characters(where: {name: {_eq: "Harry Potter"}}) {
name
book_characters {
book {
title
}
}
contributions {
author {
name
}
}
}
}