Contributions
Last Updated July 25, 2025
ReferenceWhat is a Contribution?
A Contribution in Hardcover represents the relationship between an author and a book or edition, along with the specific role the author played. This flexible system allows for various types of contributions including writing, illustration, translation, editing, and more, providing detailed credit information for all contributors to a work.
Fields
Field | Type | Description |
---|---|---|
id | bigint | Unique identifier for the contribution |
author_id | int | ID of the contributing author |
contributable_id | int | ID of the item being contributed to (book or edition) |
contributable_type | string | Type of item: “Book” or “Edition” |
contribution | string | Role or type of contribution (Author, Illustrator, Translator, etc.) |
created_at | timestamp | When the contribution was recorded |
updated_at | timestamp | When the contribution was last updated |
author | Author | Author object with complete information |
book | Book | Book object (when contributable_type is “Book”) |
Common Contribution Types
Contribution Type | Description |
---|---|
Author | Primary writer of the book |
Illustrator | Created illustrations or artwork |
Translator | Translated the work to another language |
Editor | Edited or compiled the work |
Narrator | Narrated the audiobook version |
Foreword | Wrote the foreword or introduction |
Afterword | Wrote the afterword or conclusion |
Cover Artist | Created the cover art or design |
Related Schemas
- Authors - The contributors to books
- Books - Works that receive contributions
- Editions - Specific editions with unique contributions
Example Queries
Get Book Contributors
Retrieve all contributors for a specific book with their roles:
query GetBookContributors { books(where: {id: {_eq: 328491}}) { id title contributions { id contribution author { id name bio } } }}
Get Author’s Contributions
Find all works an author has contributed to with their roles:
query GetAuthorContributions { contributions( where: {author_id: {_eq: 80626}} order_by: {created_at: desc} ) { id contribution contributable_type book { id title release_year rating } created_at }}
Find Books by Illustrator
Search for books that have illustrators and display their names:
query FindBooksByContributor { contributions( where: { contribution: {_eq: "Illustrator"} book: {id: {_is_null: false}} } order_by: {created_at: desc} limit: 10 ) { id contribution author { name } book { id title rating release_year } }}
Find Authors with Multiple Roles
Discover authors who have contributed to books in different roles (e.g., as both author and illustrator):
query AuthorMultipleRoles { authors( where: { contributions_aggregate: { count: { predicate: {_gt: 0}, filter: {contribution: {_neq: "Author"}} } } } ) { id name contributions_aggregate( distinct_on: contribution ) { nodes { contribution } } contributions( distinct_on: contribution limit: 5 ) { contribution } }}
Edition-Specific Contributors
Find contributors specific to particular editions:
query EditionContributors { contributions( where: {contributable_type: {_eq: "Edition"}} order_by: {created_at: desc} limit: 20 ) { id contribution author { name } # The contributable_id field references the edition ID # You can join this with editions table to get edition details contributable_id created_at }}