import { useQuery } from "urql"; import { ArticleList } from "../components"; import { GetUnreadArticlesDocument } from "../graphql/generated/graphql"; export function UnreadArticles() { const [{ data, fetching, error }] = useQuery({ query: GetUnreadArticlesDocument, }); if (fetching) { return
{data.unreadArticles.length} article {data.unreadArticles.length !== 1 ? "s" : ""}
)}