Lists
Questi contenuti non sono ancora disponibili nella tua lingua.
Ultimo Aggiornamento 6 giugno 2025
ReferenceWhat is a List?
Lists in Hardcover are user-created collections of books organized around themes, genres, or personal preferences. Users can create public or private lists to organize and share their reading recommendations with the community.
Fields
Field | Type | Description |
---|---|---|
id | int | Unique identifier for the list |
name | string | The title/name of the list |
description | string | Description of the list’s purpose or theme |
slug | string | URL-friendly identifier for the list |
books_count | int | Total number of books in the list |
likes_count | int | Number of users who have liked this list |
public | bool | Whether the list is publicly visible |
privacy_setting_id | int | Privacy setting for the list: 1 = public, 2 = followers only, 3 = private |
user_id | int | ID of the user who created the list |
created_at | timestamp | When the list was created |
updated_at | timestamp | When the list was last modified |
user | User | User object of the list creator |
list_books | ListBook[] | Array of books associated with this list |
Related Schemas
Example Queries
Get All Public Lists
Retrieve the top 10 most-liked public lists.
query GetPublicLists { lists( where: {public: {_eq: true}} order_by: {likes_count: desc} limit: 10 ) { id name description books_count likes_count user { username } }}
Get Lists by a Specific User
Get all lists created by a specific user. Replace ##USER_ID## with the actual user ID.
query GetUserLists { lists( where: {user_id: {_eq: ##USER_ID##}} order_by: {updated_at: desc} ) { id name description books_count public created_at updated_at }}
Get Books in a Specific List
Get all books in a specific list with their details.
This example uses NPR Top 100 Science Fiction Fantasy list (ID: 3).
query GetListBooks { lists(where: {id: {_eq: 3}}) { name description list_books { book { id title contributions { author { name } } rating pages } position date_added } }}
Create a New List
Create a new list with name, description, and privacy setting.
Privacy settings:
1
= public2
= followers only3
= private
mutation CreateList { insert_list( object: { name: "My Favorite Sci-Fi Books" description: "A collection of the best science fiction novels I've read" privacy_setting_id: 1 } ) { list { id name description public created_at } }}
Add a Book to a List
Add a book to your own list.
mutation AddBookToList { insert_list_book( object: { list_id: 27818 book_id: 456 position: 1 } ) { list_book { id list_id book_id position date_added } }}