import React from 'react'; import { Card, Link, Typography } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; import { makeStyles } from '@material-ui/core/styles'; import Date from '../../components/Date'; import { useGetBugsByUserQuery } from './GetBugsByUser.generated'; const useStyles = makeStyles((theme) => ({ main: { ...theme.typography.body2, }, bugLink: { ...theme.typography.button, }, cards: { backgroundColor: theme.palette.background.default, color: theme.palette.info.contrastText, padding: theme.spacing(1), margin: theme.spacing(1), }, })); type Props = { humanId: string; }; function BugList({ humanId }: Props) { const classes = useStyles(); const { loading, error, data } = useGetBugsByUserQuery({ variables: { query: 'author:' + humanId + ' sort:creation', }, }); if (loading) return ; if (error) return

Error: {error}

; const bugs = data?.repository?.allBugs.nodes; console.log(bugs); return (
{bugs?.map((bug, index) => { return ( {bug.title} Created  Last edited  ); })}
); } export default BugList;