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

Error: {error}

; if (!data?.repository?.identity) return

404.

; return ; }; export default UserQuery;