mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-06 13:08:14 +08:00
83 lines
2.4 KiB
JavaScript
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),
|
|
},
|
|
}),
|
|
};
|