import CircularProgress from '@material-ui/core/CircularProgress'; import React from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { useGetBugQuery } from './BugQuery.generated'; import Bug from './Bug'; type Props = RouteComponentProps<{ id: string }>; const BugQuery: React.FC = ({ match }: Props) => { const { loading, error, data } = useGetBugQuery({ variables: { id: match.params.id } }); if (loading) return ; if (error) return

Error: {error}

; if (!data?.defaultRepository?.bug) return

404.

; return ; }; export default BugQuery;