library-graphql

Mutation.returnBook

GRAPHQLMutation.returnBook

Return a borrowed book: closes the loan and flips the book's status back to AVAILABLE.

Parameters

NameInTypeRequiredDescription
idargumentID!yesThe id of the loan to close.

Responses

result Loan!

FieldTypeRequiredDescription
bookBook!yesThe borrowed book.
authorAuthor!yesThe author who wrote this book.
bioString!yesA short biography of the author.
books[Book!]!yesThe books this author has written.
idID!yesUnique identifier assigned by the server, prefixed with au_.
nameString!yesThe author's full name.
authorIdID!yesThe id of the Author who wrote this book.
createdAtTime!yesWhen the book record was created.
currentLoanLoanThe open loan currently holding this book, or null if it is available.
idID!yesUnique identifier assigned by the server, prefixed with bk_.
isbnString!yesThe book's ISBN. Must be unique across the catalog.
publishedYearInt!yesThe year the book was first published. Must be between 1450 and next year.
statusBookStatus!yesThe book's current availability.
titleString!yesThe book's display title, 1-200 characters.
updatedAtTime!yesWhen the book record was last modified.
bookIdID!yesThe id of the borrowed Book.
borrowedAtTime!yesWhen the loan started.
dueAtTime!yesWhen the book is expected back.
idID!yesUnique identifier assigned by the server, prefixed with ln_.
overdueBoolean!yesComputed at query time: true if the loan is still open and past its dueAt. Never stored, so it never goes stale.
returnedAtTimeWhen the book was actually returned, or null while the loan is still open.
userUser!yesThe user who borrowed the book.
emailString!yesThe user's contact email address.
idID!yesUnique identifier assigned by the server, prefixed with us_.
loans[Loan!]!yesEvery loan (open or closed) made by this user.
nameString!yesThe user's full name.
registeredAtTime!yesWhen the user joined the library.
userIdID!yesThe id of the User who borrowed the book.