forked from atom/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathissue-timeline-controller.js
More file actions
55 lines (53 loc) · 1.45 KB
/
issue-timeline-controller.js
File metadata and controls
55 lines (53 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import {graphql, createPaginationContainer} from 'react-relay';
import IssueishTimelineView from '../views/issueish-timeline-view';
export default createPaginationContainer(IssueishTimelineView, {
issue: graphql`
fragment issueTimelineController_issue on Issue
@argumentDefinitions(
timelineCount: {type: "Int!"},
timelineCursor: {type: "String"}
) {
url
timelineItems(
first: $timelineCount, after: $timelineCursor
) @connection(key: "IssueTimelineController_timelineItems") {
pageInfo { endCursor hasNextPage }
edges {
cursor
node {
__typename
...issueCommentView_item
...crossReferencedEventsView_nodes
}
}
}
}
`,
}, {
direction: 'forward',
getConnectionFromProps(props) {
return props.issue.timeline;
},
getFragmentVariables(prevVars, totalCount) {
return {
...prevVars,
timelineCount: totalCount,
};
},
getVariables(props, {count, cursor}, fragmentVariables) {
return {
url: props.issue.url,
timelineCount: count,
timelineCursor: cursor,
};
},
query: graphql`
query issueTimelineControllerQuery($timelineCount: Int!, $timelineCursor: String, $url: URI!) {
resource(url: $url) {
... on Issue {
...issueTimelineController_issue @arguments(timelineCount: $timelineCount, timelineCursor: $timelineCursor)
}
}
}
`,
});