TimelineQuery.js

 1import CircularProgress from '@material-ui/core/CircularProgress';
 2import React from 'react';
 3
 4import Timeline from './Timeline';
 5import { useTimelineQuery } from './TimelineQuery.generated';
 6
 7const TimelineQuery = ({ id }) => {
 8  const { loading, error, data, fetchMore } = useTimelineQuery({
 9    variables: {
10      id,
11      first: 100,
12    },
13  });
14
15  if (loading) return <CircularProgress />;
16  if (error) return <p>Error: {error}</p>;
17  return (
18    <Timeline
19      ops={data.defaultRepository.bug.timeline.nodes}
20      fetchMore={fetchMore}
21    />
22  );
23};
24
25export default TimelineQuery;