Salta ai contenuti

Authors

Last updated on December 29, 2024

Reference

Author Schema

The author schema contains the following fields:

Fields

FieldTypeDescription
alternate_namesArray of StringsAlternate names for the author
bioStringThe biography of the author
books_countIntThe number of books the author has contributed to
born_dateDateThe date the author was born
born_yearIntThe year the author was born
cached_imageObjectMetadata for the authors image. This includes the image id, url, primary color, width, and height
contributionsContributionThe contributions the author is listed on
death_dateDateThe date the author died
death_yearIntThe year the author died
idStringThe unique identifier of the author
identifiersArray of objectsIDs for the author on other platforms
is_bipocBooleanWhether the author is Black, Indigenous, or a Person of Color
is_lgbtqBooleanWhether the author is LGBTQ+
nameStringThe name of the author
slugStringThe Hardcover URL slug

Example Queries

Get an Author by ID

Example Query
query {
authors(where: {id: {_eq: "80626"}}, limit: 1) {
id,
name
}
}

Get an Author by Name

Example Query
query {
authors(where: {name: {_eq: "J.K. Rowling"}}) {
books_count
identifiers
name
}
}

Get all Authors

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

Get books by an Author

Example Query
query GetBooksByAuthor {
authors(where: {name: {_eq: "Dan Wells"}}) {
books_count
name
contributions(where: {contributable_type: {_eq: "Book"}}) {
book {
title
}
}
}
}