Authors
Last updated on December 29, 2024
ReferenceAuthor Schema
The author schema contains the following fields:
Fields
Field | Type | Description |
---|---|---|
alternate_names | Array of Strings | Alternate names for the author |
bio | String | The biography of the author |
books_count | Int | The number of books the author has contributed to |
born_date | Date | The date the author was born |
born_year | Int | The year the author was born |
cached_image | Object | Metadata for the authors image. This includes the image id, url, primary color, width, and height |
contributions | Contribution | The contributions the author is listed on |
death_date | Date | The date the author died |
death_year | Int | The year the author died |
id | String | The unique identifier of the author |
identifiers | Array of objects | IDs for the author on other platforms |
is_bipoc | Boolean | Whether the author is Black, Indigenous, or a Person of Color |
is_lgbtq | Boolean | Whether the author is LGBTQ+ |
name | String | The name of the author |
slug | String | The Hardcover URL slug |
Example Queries
Get an Author by ID
query { authors(where: {id: {_eq: "80626"}}, limit: 1) { id, name }}
Get an Author by Name
query { authors(where: {name: {_eq: "J.K. Rowling"}}) { books_count identifiers name }}
Get all Authors
query { authors(limit: 10) { id, name }}
Get books by an Author
query GetBooksByAuthor { authors(where: {name: {_eq: "Dan Wells"}}) { books_count name contributions(where: {contributable_type: {_eq: "Book"}}) { book { title } } }}