diff --git a/lib/routes/daily/discussed.ts b/lib/routes/daily/discussed.ts index b7e101aa3..92973c8a7 100644 --- a/lib/routes/daily/discussed.ts +++ b/lib/routes/daily/discussed.ts @@ -3,54 +3,51 @@ import { ViewType } from '@/types'; import { baseUrl, getData, getList, variables } from './utils.js'; -const query = ` - query MostDiscussedFeed( - $first: Int - $supportedTypes: [String!] = ["article","share","freeform"] - ) { - page: mostDiscussedFeed(first: $first, supportedTypes: $supportedTypes) { - ...FeedPostConnection +const query = /* GraphQL */ ` + query MostDiscussedFeed($first: Int, $supportedTypes: [String!] = ["article", "share", "freeform"]) { + page: mostDiscussedFeed(first: $first, supportedTypes: $supportedTypes) { + ...FeedPostConnection + } } - } - fragment FeedPostConnection on PostConnection { - edges { - node { - ...FeedPost - contentHtml - } + fragment FeedPostConnection on PostConnection { + edges { + node { + ...FeedPost + contentHtml + } + } } - } - fragment FeedPost on Post { - ...SharedPostInfo - } - - fragment SharedPostInfo on Post { - id - title - image - readTime - permalink - commentsPermalink - summary - createdAt - numUpvotes - numComments - author { - ...UserShortInfo + fragment FeedPost on Post { + ...SharedPostInfo } - tags - } - fragment UserShortInfo on User { - id - name - image - permalink - username - bio - } + fragment SharedPostInfo on Post { + id + title + image + readTime + permalink + commentsPermalink + summary + createdAt + numUpvotes + numComments + author { + ...UserShortInfo + } + tags + } + + fragment UserShortInfo on User { + id + name + image + permalink + username + bio + } `; export const route: Route = { diff --git a/lib/routes/daily/popular.ts b/lib/routes/daily/popular.ts index e9d673381..8360dc059 100644 --- a/lib/routes/daily/popular.ts +++ b/lib/routes/daily/popular.ts @@ -3,124 +3,110 @@ import { ViewType } from '@/types'; import { baseUrl, getData, getList, variables } from './utils.js'; -const query = ` - query AnonymousFeed( - $loggedIn: Boolean! = false - $first: Int - $after: String - $ranking: Ranking - $version: Int - $supportedTypes: [String!] = ["article","share","freeform","video:youtube","collection"] - ) { - page: anonymousFeed( - first: $first - after: $after - ranking: $ranking - version: $version - supportedTypes: $supportedTypes - ) { - ...FeedPostConnection +const query = /* GraphQL */ ` + query AnonymousFeed($loggedIn: Boolean! = false, $first: Int, $after: String, $ranking: Ranking, $version: Int, $supportedTypes: [String!] = ["article", "share", "freeform", "video:youtube", "collection"]) { + page: anonymousFeed(first: $first, after: $after, ranking: $ranking, version: $version, supportedTypes: $supportedTypes) { + ...FeedPostConnection + } } - } - - fragment FeedPostConnection on PostConnection { - pageInfo { - hasNextPage - endCursor + + fragment FeedPostConnection on PostConnection { + pageInfo { + hasNextPage + endCursor + } + edges { + node { + ...FeedPost + contentHtml + ...UserPost @include(if: $loggedIn) + } + } } - edges { - node { - ...FeedPost - contentHtml - ...UserPost @include(if: $loggedIn) - } + + fragment FeedPost on Post { + ...FeedPostInfo + sharedPost { + id + title + image + readTime + permalink + commentsPermalink + createdAt + type + tags + source { + id + handle + permalink + image + } + slug + clickbaitTitleDetected + } + trending + feedMeta + collectionSources { + handle + image + } + numCollectionSources + updatedAt + slug } - } - - fragment FeedPost on Post { - ...FeedPostInfo - sharedPost { - id - title - image - readTime - permalink - commentsPermalink - createdAt - type - tags - source { + + fragment FeedPostInfo on Post { id - handle - permalink + title image - } - slug - clickbaitTitleDetected + readTime + permalink + commentsPermalink + createdAt + commented + bookmarked + views + numUpvotes + numComments + summary + bookmark { + remindAt + } + author { + id + name + image + username + permalink + } + type + tags + source { + id + handle + name + permalink + image + type + } + userState { + vote + flags { + feedbackDismiss + } + } + slug + clickbaitTitleDetected } - trending - feedMeta - collectionSources { - handle - image + + fragment UserPost on Post { + read + upvoted + commented + bookmarked + downvoted } - numCollectionSources - updatedAt - slug - } - - - fragment FeedPostInfo on Post { - id - title - image - readTime - permalink - commentsPermalink - createdAt - commented - bookmarked - views - numUpvotes - numComments - summary - bookmark { - remindAt - } - author { - id - name - image - username - permalink - } - type - tags - source { - id - handle - name - permalink - image - type - } - userState { - vote - flags { - feedbackDismiss - } - } - slug - clickbaitTitleDetected - } - - fragment UserPost on Post { - read - upvoted - commented - bookmarked - downvoted - } `; export const route: Route = { diff --git a/lib/routes/daily/source.ts b/lib/routes/daily/source.ts index b764d5527..0c9aba5a4 100644 --- a/lib/routes/daily/source.ts +++ b/lib/routes/daily/source.ts @@ -15,115 +15,110 @@ interface Source { type: string; } -const sourceFeedQuery = ` -query SourceFeed($source: ID!, $loggedIn: Boolean! = false, $first: Int, $after: String, $ranking: Ranking, $supportedTypes: [String!]) { - page: sourceFeed( - source: $source - first: $first - after: $after - ranking: $ranking - supportedTypes: $supportedTypes - ) { - ...FeedPostConnection - } -} - -fragment FeedPostConnection on PostConnection { - pageInfo { - hasNextPage - endCursor - } - edges { - node { - ...FeedPost - pinnedAt - contentHtml - ...UserPost @include(if: $loggedIn) +const sourceFeedQuery = /* GraphQL */ ` + query SourceFeed($source: ID!, $loggedIn: Boolean! = false, $first: Int, $after: String, $ranking: Ranking, $supportedTypes: [String!]) { + page: sourceFeed(source: $source, first: $first, after: $after, ranking: $ranking, supportedTypes: $supportedTypes) { + ...FeedPostConnection + } } - } -} -fragment FeedPost on Post { - ...FeedPostInfo - sharedPost { - id - title - image - readTime - permalink - commentsPermalink - createdAt - type - tags - source { - id - handle - permalink - image + fragment FeedPostConnection on PostConnection { + pageInfo { + hasNextPage + endCursor + } + edges { + node { + ...FeedPost + pinnedAt + contentHtml + ...UserPost @include(if: $loggedIn) + } + } } - slug - } - trending - feedMeta - collectionSources { - handle - image - } - numCollectionSources - updatedAt - slug -} -fragment FeedPostInfo on Post { - id - title - image - readTime - permalink - commentsPermalink - createdAt - commented - bookmarked - views - numUpvotes - numComments - summary - bookmark { - remindAt - } - author { - id - name - image - username - permalink - } - type - tags - source { - id - handle - name - permalink - image - type - } - userState { - vote - flags { - feedbackDismiss + fragment FeedPost on Post { + ...FeedPostInfo + sharedPost { + id + title + image + readTime + permalink + commentsPermalink + createdAt + type + tags + source { + id + handle + permalink + image + } + slug + } + trending + feedMeta + collectionSources { + handle + image + } + numCollectionSources + updatedAt + slug } - } - slug -} -fragment UserPost on Post { - read - upvoted - commented - bookmarked - downvoted -}`; + fragment FeedPostInfo on Post { + id + title + image + readTime + permalink + commentsPermalink + createdAt + commented + bookmarked + views + numUpvotes + numComments + summary + bookmark { + remindAt + } + author { + id + name + image + username + permalink + } + type + tags + source { + id + handle + name + permalink + image + type + } + userState { + vote + flags { + feedbackDismiss + } + } + slug + } + + fragment UserPost on Post { + read + upvoted + commented + bookmarked + downvoted + } +`; export const route: Route = { path: '/source/:sourceId/:innerSharedContent?', diff --git a/lib/routes/daily/squads.ts b/lib/routes/daily/squads.ts index 13af46188..5bc199aca 100644 --- a/lib/routes/daily/squads.ts +++ b/lib/routes/daily/squads.ts @@ -3,203 +3,188 @@ import { ViewType } from '@/types'; import { baseUrl, getData, getList, variables } from './utils.js'; -const sourceQuery = ` -query Source($handle: ID!) { - source(id: $handle) { - ...SquadBaseInfo - moderationPostCount +const sourceQuery = /* GraphQL */ ` + query Source($handle: ID!) { + source(id: $handle) { + ...SquadBaseInfo + moderationPostCount + } } - } - fragment SquadBaseInfo on Source { - ...SourceBaseInfo - referralUrl - createdAt - flags { - featured - totalPosts - totalViews - totalUpvotes + fragment SquadBaseInfo on Source { + ...SourceBaseInfo + referralUrl + createdAt + flags { + featured + totalPosts + totalViews + totalUpvotes + } + category { + id + title + slug + } + ...PrivilegedMembers } - category { - id - title - slug - } - ...PrivilegedMembers - } - fragment SourceBaseInfo on Source { - id - active - handle - name - permalink - public - type - description - image - membersCount - currentMember { - ...CurrentMember - } - memberPostingRole - memberInviteRole - moderationRequired - } - fragment CurrentMember on SourceMember { - user { - id - } - permissions - role - referralToken - flags { - hideFeedPosts - collapsePinnedPosts - } - } - fragment PrivilegedMembers on Source { - privilegedMembers { - user { + fragment SourceBaseInfo on Source { id + active + handle name - image permalink - username - bio - reputation - companies { - name - image + public + type + description + image + membersCount + currentMember { + ...CurrentMember + } + memberPostingRole + memberInviteRole + moderationRequired + } + fragment CurrentMember on SourceMember { + user { + id + } + permissions + role + referralToken + flags { + hideFeedPosts + collapsePinnedPosts + } + } + fragment PrivilegedMembers on Source { + privilegedMembers { + user { + id + name + image + permalink + username + bio + reputation + companies { + name + image + } + contentPreference { + status + } + } + role } - contentPreference { - status - } - } - role } - } - `; -const query = ` - query SourceFeed( - $source: ID! - $loggedIn: Boolean! = false - $first: Int - $after: String - $ranking: Ranking - $supportedTypes: [String!] - ) { - page: sourceFeed( - source: $source - first: $first - after: $after - ranking: $ranking - supportedTypes: $supportedTypes - ) { - ...FeedPostConnection +const query = /* GraphQL */ ` + query SourceFeed($source: ID!, $loggedIn: Boolean! = false, $first: Int, $after: String, $ranking: Ranking, $supportedTypes: [String!]) { + page: sourceFeed(source: $source, first: $first, after: $after, ranking: $ranking, supportedTypes: $supportedTypes) { + ...FeedPostConnection + } } - } - - fragment FeedPostConnection on PostConnection { - pageInfo { - hasNextPage - endCursor + + fragment FeedPostConnection on PostConnection { + pageInfo { + hasNextPage + endCursor + } + edges { + node { + ...FeedPost + pinnedAt + contentHtml + ...UserPost @include(if: $loggedIn) + } + } } - edges { - node { - ...FeedPost - pinnedAt contentHtml - ...UserPost @include(if: $loggedIn) - } + + fragment FeedPost on Post { + ...FeedPostInfo + sharedPost { + id + title + image + readTime + permalink + commentsPermalink + createdAt + type + tags + source { + id + handle + permalink + image + } + slug + clickbaitTitleDetected + } + trending + feedMeta + collectionSources { + handle + image + } + numCollectionSources + updatedAt + slug } - } - - fragment FeedPost on Post { - ...FeedPostInfo - sharedPost { - id - title - image - readTime - permalink - commentsPermalink - createdAt - type - tags - source { + + fragment FeedPostInfo on Post { id - handle - permalink + title image - } - slug - clickbaitTitleDetected + readTime + permalink + commentsPermalink + createdAt + commented + bookmarked + views + numUpvotes + numComments + summary + bookmark { + remindAt + } + author { + id + name + image + username + permalink + } + type + tags + source { + id + handle + name + permalink + image + type + } + userState { + vote + flags { + feedbackDismiss + } + } + slug + clickbaitTitleDetected } - trending - feedMeta - collectionSources { - handle - image - } - numCollectionSources - updatedAt - slug - } - - fragment FeedPostInfo on Post { - id - title - image - readTime - permalink - commentsPermalink - createdAt - commented - bookmarked - views - numUpvotes - numComments - summary - bookmark { - remindAt - } - author { - id - name - image - username - permalink - } - type - tags - source { - id - handle - name - permalink - image - type - } - userState { - vote - flags { - feedbackDismiss - } - } - slug - clickbaitTitleDetected - } - - - fragment UserPost on Post { - read - upvoted - commented - bookmarked - downvoted - } + fragment UserPost on Post { + read + upvoted + commented + bookmarked + downvoted + } `; export const route: Route = { diff --git a/lib/routes/daily/upvoted.ts b/lib/routes/daily/upvoted.ts index 775d909dd..06885d298 100644 --- a/lib/routes/daily/upvoted.ts +++ b/lib/routes/daily/upvoted.ts @@ -3,121 +3,110 @@ import { ViewType } from '@/types'; import { baseUrl, getData, getList, variables } from './utils.js'; -const query = ` - query MostUpvotedFeed( - $loggedIn: Boolean! = false - $first: Int - $after: String - $period: Int - $supportedTypes: [String!] = ["article","share","freeform","video:youtube","collection"] - $source: ID - $tag: String - ) { - page: mostUpvotedFeed(first: $first, after: $after, period: $period, supportedTypes: $supportedTypes, source: $source, tag: $tag) { - ...FeedPostConnection +const query = /* GraphQL */ ` + query MostUpvotedFeed($loggedIn: Boolean! = false, $first: Int, $after: String, $period: Int, $supportedTypes: [String!] = ["article", "share", "freeform", "video:youtube", "collection"], $source: ID, $tag: String) { + page: mostUpvotedFeed(first: $first, after: $after, period: $period, supportedTypes: $supportedTypes, source: $source, tag: $tag) { + ...FeedPostConnection + } } - } - - fragment FeedPostConnection on PostConnection { - pageInfo { - hasNextPage - endCursor + + fragment FeedPostConnection on PostConnection { + pageInfo { + hasNextPage + endCursor + } + edges { + node { + ...FeedPost + contentHtml + ...UserPost @include(if: $loggedIn) + } + } } - edges { - node { - ...FeedPost - contentHtml - ...UserPost @include(if: $loggedIn) - } + + fragment FeedPost on Post { + ...FeedPostInfo + sharedPost { + id + title + image + readTime + permalink + commentsPermalink + createdAt + type + tags + source { + id + handle + permalink + image + } + slug + clickbaitTitleDetected + } + trending + feedMeta + collectionSources { + handle + image + } + numCollectionSources + updatedAt + slug } - } - - fragment FeedPost on Post { - ...FeedPostInfo - sharedPost { - id - title - image - readTime - permalink - commentsPermalink - createdAt - type - tags - source { + + fragment FeedPostInfo on Post { id - handle - permalink + title image - } - slug - clickbaitTitleDetected + readTime + permalink + commentsPermalink + createdAt + commented + bookmarked + views + numUpvotes + numComments + summary + bookmark { + remindAt + } + author { + id + name + image + username + permalink + } + type + tags + source { + id + handle + name + permalink + image + type + } + userState { + vote + flags { + feedbackDismiss + } + } + slug + clickbaitTitleDetected } - trending - feedMeta - collectionSources { - handle - image - } - numCollectionSources - updatedAt - slug - } - - fragment FeedPostInfo on Post { - id - title - image - readTime - permalink - commentsPermalink - createdAt - commented - bookmarked - views - numUpvotes - numComments - summary - bookmark { - remindAt - } - author { - id - name - image - username - permalink - } - type - tags - source { - id - handle - name - permalink - image - type - } - userState { - vote - flags { - feedbackDismiss - } - } - slug - clickbaitTitleDetected - } - - - - fragment UserPost on Post { - read - upvoted - commented - bookmarked - downvoted - } + fragment UserPost on Post { + read + upvoted + commented + bookmarked + downvoted + } `; export const route: Route = { diff --git a/lib/routes/daily/user.ts b/lib/routes/daily/user.ts index 387702372..cbffaed74 100644 --- a/lib/routes/daily/user.ts +++ b/lib/routes/daily/user.ts @@ -5,151 +5,134 @@ import ofetch from '@/utils/ofetch'; import { baseUrl, getBuildId, getData, getList } from './utils'; -const userPostQuery = ` - query AuthorFeed( - $loggedIn: Boolean! = false - $userId: ID! - $after: String - $first: Int - $supportedTypes: [String!] = [ - "article" - "share" - "freeform" - "video:youtube" - "collection" - ] - ) { - page: authorFeed( - author: $userId - after: $after - first: $first - ranking: TIME - supportedTypes: $supportedTypes - ) { - ...FeedPostConnection +const userPostQuery = /* GraphQL */ ` + query AuthorFeed($loggedIn: Boolean! = false, $userId: ID!, $after: String, $first: Int, $supportedTypes: [String!] = ["article", "share", "freeform", "video:youtube", "collection"]) { + page: authorFeed(author: $userId, after: $after, first: $first, ranking: TIME, supportedTypes: $supportedTypes) { + ...FeedPostConnection + } } - } - fragment FeedPostConnection on PostConnection { - pageInfo { - hasNextPage - endCursor + fragment FeedPostConnection on PostConnection { + pageInfo { + hasNextPage + endCursor + } + edges { + node { + ...FeedPost + contentHtml + ...UserPost @include(if: $loggedIn) + } + } } - edges { - node { - ...FeedPost - contentHtml - ...UserPost @include(if: $loggedIn) - } + fragment FeedPost on Post { + ...SharedPostInfo + sharedPost { + ...SharedPostInfo + } + trending + feedMeta + collectionSources { + handle + image + } + numCollectionSources + updatedAt + slug } - } - fragment FeedPost on Post { - ...SharedPostInfo - sharedPost { - ...SharedPostInfo - } - trending - feedMeta - collectionSources { - handle - image - } - numCollectionSources - updatedAt - slug - } - fragment SharedPostInfo on Post { - id - title - titleHtml - image - readTime - permalink - commentsPermalink - summary - createdAt - private - upvoted - commented - bookmarked - views - numUpvotes - numComments - videoId - scout { - ...UserShortInfo - } - author { - ...UserShortInfo - } - type - tags - source { - ...SourceBaseInfo - } - downvoted - flags { - promoteToPublic - } - userState { - vote - flags { - feedbackDismiss - } - } - slug - } - fragment SourceBaseInfo on Source { - id - active - handle - name - permalink - public - type - description - image - membersCount - privilegedMembers { - user { + fragment SharedPostInfo on Post { id - } - role + title + titleHtml + image + readTime + permalink + commentsPermalink + summary + createdAt + private + upvoted + commented + bookmarked + views + numUpvotes + numComments + videoId + scout { + ...UserShortInfo + } + author { + ...UserShortInfo + } + type + tags + source { + ...SourceBaseInfo + } + downvoted + flags { + promoteToPublic + } + userState { + vote + flags { + feedbackDismiss + } + } + slug } - currentMember { - ...CurrentMember + fragment SourceBaseInfo on Source { + id + active + handle + name + permalink + public + type + description + image + membersCount + privilegedMembers { + user { + id + } + role + } + currentMember { + ...CurrentMember + } + memberPostingRole + memberInviteRole } - memberPostingRole - memberInviteRole - } - fragment CurrentMember on SourceMember { - user { - id + fragment CurrentMember on SourceMember { + user { + id + } + permissions + role + referralToken + flags { + hideFeedPosts + collapsePinnedPosts + } } - permissions - role - referralToken - flags { - hideFeedPosts - collapsePinnedPosts + fragment UserShortInfo on User { + id + name + image + permalink + username + bio + createdAt + reputation } - } - fragment UserShortInfo on User { - id - name - image - permalink - username - bio - createdAt - reputation - } - fragment UserPost on Post { - read - upvoted - commented - bookmarked - downvoted - }`; + fragment UserPost on Post { + read + upvoted + commented + bookmarked + downvoted + } +`; export const route: Route = { path: '/user/:userId/:innerSharedContent?', diff --git a/lib/routes/digg/community.tsx b/lib/routes/digg/community.tsx index b88d528d8..182f5f4ac 100644 --- a/lib/routes/digg/community.tsx +++ b/lib/routes/digg/community.tsx @@ -135,7 +135,7 @@ async function handler(ctx) { } = await ofetch(graphqlUrl, { method: 'POST', body: { - query: `query CommunityQuery($id: ID, $slug: String) { + query: /* GraphQL */ `query CommunityQuery($id: ID, $slug: String) { community(where: { _id_EQ: $id, slug_EQ: $slug }) { ...CommunityFragment topContributors { @@ -232,7 +232,7 @@ fragment ImageFragment on Image { } = await ofetch(graphqlUrl, { method: 'POST', body: { - query: `query PostsQuery( + query: /* GraphQL */ `query PostsQuery( $first: Int $after: String $where: PostWhere diff --git a/lib/routes/galxe/index.ts b/lib/routes/galxe/index.ts index 90110bd75..469bf3fc2 100644 --- a/lib/routes/galxe/index.ts +++ b/lib/routes/galxe/index.ts @@ -45,7 +45,7 @@ async function handler(ctx) { listType: 'Newest', }, }, - query: ` + query: /* GraphQL */ ` query BrowseSpaceCampaigns($id: Int, $alias: String, $campaignInput: ListCampaignInput!) { space(id: $id, alias: $alias) { id diff --git a/lib/routes/github/follower.ts b/lib/routes/github/follower.ts index 47941fb95..b9503abc0 100644 --- a/lib/routes/github/follower.ts +++ b/lib/routes/github/follower.ts @@ -42,7 +42,7 @@ async function handler(ctx) { Authorization: `bearer ${config.github.access_token}`, }, json: { - query: ` + query: /* GraphQL */ ` { user(login: "${user}") { followers(first: 10) { diff --git a/lib/routes/github/star.ts b/lib/routes/github/star.ts index dd873c959..f369b8f8d 100644 --- a/lib/routes/github/star.ts +++ b/lib/routes/github/star.ts @@ -45,7 +45,7 @@ async function handler(ctx) { Authorization: `bearer ${config.github.access_token}`, }, json: { - query: ` + query: /* GraphQL */ ` { repository(owner: "${user}", name: "${repo}") { stargazers(last: 10) { diff --git a/lib/routes/github/trending.tsx b/lib/routes/github/trending.tsx index a14ba30c9..c3d4ec092 100644 --- a/lib/routes/github/trending.tsx +++ b/lib/routes/github/trending.tsx @@ -98,7 +98,7 @@ async function handler(ctx) { Authorization: `bearer ${config.github.access_token}`, }, json: { - query: ` + query: /* GraphQL */ ` query { ${trendingRepos .map( diff --git a/lib/routes/hashnode/blog.tsx b/lib/routes/hashnode/blog.tsx index 75ad8c51d..9ba9fdf3a 100644 --- a/lib/routes/hashnode/blog.tsx +++ b/lib/routes/hashnode/blog.tsx @@ -47,7 +47,7 @@ async function handler(ctx) { return; } - const query = ` + const query = /* GraphQL */ ` { user(username: "${username}") { publication { diff --git a/lib/routes/link3/events.ts b/lib/routes/link3/events.ts index 9bb4ac501..7ca0660ec 100644 --- a/lib/routes/link3/events.ts +++ b/lib/routes/link3/events.ts @@ -38,7 +38,7 @@ async function handler() { variables: { order: 'START_TIME_ASC', }, - query: ` + query: /* GraphQL */ ` query getTrendingEvents($first: Int, $after: String, $order: TrendingEventsRequest_EventOrder, $filter: TrendingEventsRequest_EventFilter) { trendingEvents(first: $first, after: $after, order: $order, filter: $filter) { list { diff --git a/lib/routes/link3/profile.ts b/lib/routes/link3/profile.ts index ec9a69206..097c72ce2 100644 --- a/lib/routes/link3/profile.ts +++ b/lib/routes/link3/profile.ts @@ -41,7 +41,7 @@ async function handler(ctx) { variables: { handle, }, - query: ` + query: /* GraphQL */ ` query getProfile($id: ID, $handle: String) { profile(id: $id, handle: $handle) { status diff --git a/lib/routes/mirrormedia/category.ts b/lib/routes/mirrormedia/category.ts index 31b4cd1c1..346e37e05 100644 --- a/lib/routes/mirrormedia/category.ts +++ b/lib/routes/mirrormedia/category.ts @@ -38,7 +38,7 @@ async function handler(ctx) { ...sectionFilter, }, }, - query: ` + query: /* GraphQL */ ` fragment section on Section { id name diff --git a/lib/routes/mymusicsheet/usersheets.tsx b/lib/routes/mymusicsheet/usersheets.tsx index 2de5d3e5a..046004d6e 100644 --- a/lib/routes/mymusicsheet/usersheets.tsx +++ b/lib/routes/mymusicsheet/usersheets.tsx @@ -56,7 +56,7 @@ async function handler(ctx) { method: 'POST', body: { operationName: 'ArtistDetailLoadUser', - query: ` + query: /* GraphQL */ ` query ArtistDetailLoadUser($artistUrl: String!) { user(artistUrl: $artistUrl) { coverUrl @@ -113,7 +113,7 @@ async function handler(ctx) { method: 'POST', body: { operationName: 'loadArtistSheets', - query: ` + query: /* GraphQL */ ` query loadArtistSheets($data: SheetSearchInput!) { sheetSearch(data: $data) { list { diff --git a/lib/routes/xiaote/index.ts b/lib/routes/xiaote/index.ts index d961b8c18..111646c44 100644 --- a/lib/routes/xiaote/index.ts +++ b/lib/routes/xiaote/index.ts @@ -29,7 +29,7 @@ export const route: Route = { async function handler() { const { data } = await got.post('https://lcen.xiaote.net//api/graphql/', { json: { - query: `query($startCursor: Int) { + query: /* GraphQL */ `query($startCursor: Int) { communities(startCursor: $startCursor) { edges { node {