library-graphql
Query.userProfile
GRAPHQL
Query.userProfileGet a user's profile: the user plus their current and historical loans.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | argument | ID! | yes | The user's unique identifier, e.g. "us_001". |
Responses
result UserProfile!
| Field | Type | Required | Description |
|---|---|---|---|
| currentLoans | [Loan!]! | yes | The user's currently open loans (not yet returned). |
| book | Book! | yes | The borrowed book. |
| author | Author! | yes | The author who wrote this book. |
| authorId | ID! | yes | The id of the Author who wrote this book. |
| createdAt | Time! | yes | When the book record was created. |
| currentLoan | Loan | The open loan currently holding this book, or null if it is available. | |
| id | ID! | yes | Unique identifier assigned by the server, prefixed with bk_. |
| isbn | String! | yes | The book's ISBN. Must be unique across the catalog. |
| publishedYear | Int! | yes | The year the book was first published. Must be between 1450 and next year. |
| status | BookStatus! | yes | The book's current availability. |
| title | String! | yes | The book's display title, 1-200 characters. |
| updatedAt | Time! | yes | When the book record was last modified. |
| bookId | ID! | yes | The id of the borrowed Book. |
| borrowedAt | Time! | yes | When the loan started. |
| dueAt | Time! | yes | When the book is expected back. |
| id | ID! | yes | Unique identifier assigned by the server, prefixed with ln_. |
| overdue | Boolean! | yes | Computed at query time: true if the loan is still open and past its dueAt. Never stored, so it never goes stale. |
| returnedAt | Time | When the book was actually returned, or null while the loan is still open. | |
| user | User! | yes | The user who borrowed the book. |
| String! | yes | The user's contact email address. | |
| id | ID! | yes | Unique identifier assigned by the server, prefixed with us_. |
| loans | [Loan!]! | yes | Every loan (open or closed) made by this user. |
| name | String! | yes | The user's full name. |
| registeredAt | Time! | yes | When the user joined the library. |
| userId | ID! | yes | The id of the User who borrowed the book. |
| loanHistory | [Loan!]! | yes | The user's closed (returned) loans. |
| book | Book! | yes | The borrowed book. |
| author | Author! | yes | The author who wrote this book. |
| authorId | ID! | yes | The id of the Author who wrote this book. |
| createdAt | Time! | yes | When the book record was created. |
| currentLoan | Loan | The open loan currently holding this book, or null if it is available. | |
| id | ID! | yes | Unique identifier assigned by the server, prefixed with bk_. |
| isbn | String! | yes | The book's ISBN. Must be unique across the catalog. |
| publishedYear | Int! | yes | The year the book was first published. Must be between 1450 and next year. |
| status | BookStatus! | yes | The book's current availability. |
| title | String! | yes | The book's display title, 1-200 characters. |
| updatedAt | Time! | yes | When the book record was last modified. |
| bookId | ID! | yes | The id of the borrowed Book. |
| borrowedAt | Time! | yes | When the loan started. |
| dueAt | Time! | yes | When the book is expected back. |
| id | ID! | yes | Unique identifier assigned by the server, prefixed with ln_. |
| overdue | Boolean! | yes | Computed at query time: true if the loan is still open and past its dueAt. Never stored, so it never goes stale. |
| returnedAt | Time | When the book was actually returned, or null while the loan is still open. | |
| user | User! | yes | The user who borrowed the book. |
| String! | yes | The user's contact email address. | |
| id | ID! | yes | Unique identifier assigned by the server, prefixed with us_. |
| loans | [Loan!]! | yes | Every loan (open or closed) made by this user. |
| name | String! | yes | The user's full name. |
| registeredAt | Time! | yes | When the user joined the library. |
| userId | ID! | yes | The id of the User who borrowed the book. |
| user | User! | yes | The user this profile belongs to. |
| String! | yes | The user's contact email address. | |
| id | ID! | yes | Unique identifier assigned by the server, prefixed with us_. |
| loans | [Loan!]! | yes | Every loan (open or closed) made by this user. |
| book | Book! | yes | The borrowed book. |
| bookId | ID! | yes | The id of the borrowed Book. |
| borrowedAt | Time! | yes | When the loan started. |
| dueAt | Time! | yes | When the book is expected back. |
| id | ID! | yes | Unique identifier assigned by the server, prefixed with ln_. |
| overdue | Boolean! | yes | Computed at query time: true if the loan is still open and past its dueAt. Never stored, so it never goes stale. |
| returnedAt | Time | When the book was actually returned, or null while the loan is still open. | |
| user | User! | yes | The user who borrowed the book. |
| userId | ID! | yes | The id of the User who borrowed the book. |
| name | String! | yes | The user's full name. |
| registeredAt | Time! | yes | When the user joined the library. |