import { useQuery } from "@apollo/client"; import { BOOKS_BY_GENRE } from "../queries"; const Recommended = ({ user }) => { const booksRes = useQuery(BOOKS_BY_GENRE, { variables: { genre: user.me.favoriteGenre }, }); if (booksRes.loading) return <>loading .... return ( <>

recommendations

books in your favotite genre
{booksRes.data.books.map((a, index) => ( ))}
author published
{a.title} {a.author.name} {a.published}
); }; export default Recommended;