import { useQuery } from '@apollo/client' import { ALL_AUTHORS } from '../queries' import BirthYearForm from './BirthYearForm' const Authors = ({ token }) => { const result = useQuery(ALL_AUTHORS) if (result.loading) { return
Loading Data...
} const authors = result.data.allAuthors if (!authors) { return
Data Not Available...
} return (

Authors

{authors.map((a) => ( ))}
Born Books
{a.name} {a.born} {a.bookCount}
{token ? : null }
) } export default Authors