import CircularProgress from '@material-ui/core/CircularProgress'; import React from 'react'; import { RouteComponentProps } from 'react-router-dom'; import Bug from './Bug'; import { useGetBugQuery } from './BugQuery.generated'; 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;