Files
RSSHub/lib/v2/lkong/query.js
Ethan Shen 2949bb4f21 fix(route): 龙空 (#9096)
* fix(route): 龙空

* fix: throw login required error
2022-02-14 21:25:43 +08:00

83 lines
2.4 KiB
JavaScript

module.exports = {
viewForum: (id) => ({
operationName: 'ViewForum',
query:
'query ViewForum($fid: Int!, $page: Int, $action: String) {' +
' forum(fid: $fid) {' +
' name' +
' }' +
' forumCount(fid: $fid) {' +
' info' +
' }' +
' hots: threadsFragment(fid: $fid, type: "hot") {' +
' tid' +
' title' +
' }' +
' threads(fid: $fid, action: $action, page: $page) {' +
' ...threadComponent' +
' }' +
'}' +
'' +
'fragment threadComponent on Thread {' +
' tid' +
' title' +
'}',
variables: {
fid: parseInt(id),
},
}),
viewThread: (id, page) => ({
operationName: 'ViewThread',
query:
'query ViewThread($tid: Int!, $page: Int, $pid: String, $authorid: Int) {' +
' thread(tid: $tid, authorid: $authorid, pid: $pid) {' +
' ...threadComponent' +
' }' +
' ...repliesComponent' +
'}' +
'' +
'fragment threadComponent on Thread {' +
' tid' +
' title' +
' dateline' +
' author {' +
' name' +
' }' +
' replies' +
' tags {' +
' name' +
' }' +
'}' +
'' +
'fragment repliesComponent on Query {' +
' posts(tid: $tid, page: $page, pid: $pid, authorid: $authorid) {' +
' lou' +
' pid' +
' content' +
' quote {' +
' author {' +
' name' +
' }' +
' pid' +
' content' +
' }' +
' dateline' +
' user {' +
' name' +
' }' +
' }' +
'}',
variables: {
tid: parseInt(id),
page,
},
}),
countReplies: (id) => ({
operationName: 'ViewThread',
query: 'query ViewThread($tid: Int!){thread(tid: $tid){...threadComponent}}fragment threadComponent on Thread{replies}',
variables: {
tid: parseInt(id),
},
}),
};