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 ops={data.repository.bug.timeline.nodes} fetchMore={fetchMore} />
19  );
20};
21
22export default TimelineQuery;