(vars, pagerDirection)
| 3 | } from '../util' |
| 4 | |
| 5 | const getQL = (vars, pagerDirection) => { |
| 6 | const cursorDirection = pagerDirection === 'last' ? 'before' : 'after' |
| 7 | const ql = ` |
| 8 | query getIssueAndComments( |
| 9 | $owner: String!, |
| 10 | $repo: String!, |
| 11 | $id: Int!, |
| 12 | $cursor: String, |
| 13 | $pageSize: Int! |
| 14 | ) { |
| 15 | repository(owner: $owner, name: $repo) { |
| 16 | issue(number: $id) { |
| 17 | title |
| 18 | url |
| 19 | bodyHTML |
| 20 | createdAt |
| 21 | comments(${pagerDirection}: $pageSize, ${cursorDirection}: $cursor) { |
| 22 | totalCount |
| 23 | pageInfo { |
| 24 | ${pagerDirection === 'last' ? 'hasPreviousPage' : 'hasNextPage'} |
| 25 | ${cursorDirection === 'before' ? 'startCursor' : 'endCursor'} |
| 26 | } |
| 27 | nodes { |
| 28 | id |
| 29 | databaseId |
| 30 | author { |
| 31 | avatarUrl |
| 32 | login |
| 33 | url |
| 34 | } |
| 35 | bodyHTML |
| 36 | body |
| 37 | createdAt |
| 38 | reactions(first: 100, content: HEART) { |
| 39 | totalCount |
| 40 | viewerHasReacted |
| 41 | pageInfo{ |
| 42 | hasNextPage |
| 43 | } |
| 44 | nodes { |
| 45 | id |
| 46 | databaseId |
| 47 | user { |
| 48 | login |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | ` |
| 58 | |
| 59 | if (vars.cursor === null) delete vars.cursor |
| 60 | |
| 61 | return { |
| 62 | operationName: 'getIssueAndComments', |
no outgoing calls
no test coverage detected