const result = await db.query.author.findFirst({
where: (author) => eq(author.slug, params.slug),
with: {
collections: {
with: {
collection: {
with: {
books: {
with: {
book: {
with: {
authors: {
where: (authorBook, { ne }) => ne(authorBook.authorId, author.id),
with: {
author: true
}
}
}
}
}
},
authors: {
with: {
author: true
}
}
}
}
}
}
}
});
const result = await db.query.author.findFirst({
where: (author) => eq(author.slug, params.slug),
with: {
collections: {
with: {
collection: {
with: {
books: {
with: {
book: {
with: {
authors: {
where: (authorBook, { ne }) => ne(authorBook.authorId, author.id),
with: {
author: true
}
}
}
}
}
},
authors: {
with: {
author: true
}
}
}
}
}
}
}
});