import { useQuery } from "urql"; import { ArticleList } from "../components"; import { GetReadArticlesDocument } from "../graphql/generated/graphql"; export function ReadArticles() { const [{ data, fetching, error }] = useQuery({ query: GetReadArticlesDocument, }); if (fetching) { return
Loading read articles...
; } if (error) { return
Error: {error.message}
; } return (

Read Articles

{data?.readArticles && (

{data.readArticles.length} article {data.readArticles.length !== 1 ? "s" : ""}

)}
{data?.readArticles && ( )}
); }