Saltearse al contenido

Users

Last updated on September 25, 2024

Reference

What is a User?

Users are the people who use the Hardcover platform. Users can perform actions like adding books to their shelves, following other users, and writing reviews.

User Schema

The user schema contains the following fields:

Fields

FieldTypeDescription
idStringThe unique identifier of the user
usernameStringThe username of the user
birthdateStringThe birthdate of the user
books_countIntThe number of books the user has added
flairStringThe flair of the user
followers_countIntThe number of followers the user has
followed_users_countIntThe number of users the user follows
locationStringThe location of the user
nameStringThe name of the user
proBoolean
pronoun_personalStringThe personal pronoun of the user
pronoun_possessiveStringThe possessive pronoun of the user
sign_in_countIntThe number of times the user has signed in
  • me — The currently authenticated user

Example Queries

Get my user information

Example Query
query {
me {
id
username
birthdate
books_count
flair
followers_count
followed_users_count
location
name
pro
pronoun_personal
pronoun_possessive
sign_in_count
}
}

Get a User by ID

Example Query
query {
users(where: {id: {_eq: "1"}}, limit: 1) {
id,
username
}
}

Get a User by Username

Example Query
query {
users(where: {username: {_eq: "adam"}}, limit: 1) {
id,
username
}
}