Characters
Last Updated April 28, 2025
ReferenceWhat 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
Field | Type | Description |
---|---|---|
id | Int | The unique identifier of the character |
name | String | The name of the character |
biography | String | A text description of the character’s background and story |
created_at | DateTime | The timestamp when the character was created in the system |
updated_at | DateTime | The timestamp when the character was last updated |
gender_id | Int | Reference to the character’s gender |
has_disability | Boolean | Indicates if the character has a disability |
is_lgbtq | Boolean | Indicates if the character identifies as LGBTQ+ |
is_poc | Boolean | Indicates if the character is a person of color |
image_id | String | Reference to an image associated with the character |
slug | String | URL-friendly version of the character’s name |
state | String | The current state of the character record (e.g., “active”) |
object_type | String | The type of object, typically “Character” |
user_id | String | The ID of the user who created or owns this character record |
Example Queries
Get a Character by ID
query { characters(where: {id: {_eq: "1"}}, limit: 1) { id, name }}
Get a Character by Name
query { characters(where: {name: {_eq: "Harry Potter"}}) { biography slug state name }}
Get all Characters
query { characters(limit: 10) { id, name }}
Get Books featuring a Character
query GetCharacterBooks { characters(where: {name: {_eq: "Harry Potter"}}) { name book_characters { book { title } } contributions { author { name } } }}