import React from 'react'; import { Redirect, RouteComponentProps } from 'react-router-dom'; import CircularProgress from '@material-ui/core/CircularProgress'; 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 (!data?.repository?.bug) return ; if (error) return

Error: {error}

; return ; }; export default BugQuery;