From 6e134d32d5bf8bdda56f26fdcf32b1770801f229 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 10:35:56 +0000 Subject: [PATCH] style: auto format --- lib/routes/afr/query.ts | 644 +++--- lib/routes/behance/queries.ts | 1956 +++++++++-------- lib/routes/fantube/utils.ts | 404 ++-- lib/routes/komiic/comic.ts | 30 +- lib/routes/leetcode/articles.ts | 12 +- lib/routes/leetcode/dailyquestion-cn.ts | 50 +- lib/routes/leetcode/dailyquestion-en.ts | 52 +- .../leetcode/dailyquestion-solution-cn.ts | 140 +- .../leetcode/dailyquestion-solution-en.ts | 98 +- lib/routes/medium/graphql.ts | 164 +- lib/routes/sustainabilitymag/articles.ts | 50 +- 11 files changed, 1813 insertions(+), 1787 deletions(-) diff --git a/lib/routes/afr/query.ts b/lib/routes/afr/query.ts index 6e9a74a423..8b80a3d385 100644 --- a/lib/routes/afr/query.ts +++ b/lib/routes/afr/query.ts @@ -1,349 +1,335 @@ -export const pageByNavigationPathQuery = /* GraphQL */ `query pageByNavigationPath( - $input: PageByNavigationPathInput! - $firstStories: Int - $afterStories: Cursor - ) { - pageByNavigationPath(input: $input) { - error { - message - type { - class - ... on ErrorTypeInvalidRequest { - fields { - field - message +export const pageByNavigationPathQuery = /* GraphQL */ ` + query pageByNavigationPath($input: PageByNavigationPathInput!, $firstStories: Int, $afterStories: Cursor) { + pageByNavigationPath(input: $input) { + error { + message + type { + class + ... on ErrorTypeInvalidRequest { + fields { + field + message + } + } + } } - } + page { + ads { + suppress + } + description + id + latestStoriesConnection(first: $firstStories, after: $afterStories) { + edges { + node { + byline { + ...AssetBylineFragment + } + headlines { + headline + } + ads { + sponsor { + name + } + } + overview { + about + label + } + type + dates { + firstPublished + published + } + id + publicId + images { + ...AssetImagesFragmentAudience + } + tags { + primary { + ...TagFragmentAudience + } + secondary { + ...TagFragmentAudience + } + } + urls { + ...AssetUrlsAudienceFragment + } + } + } + pageInfo { + endCursor + hasNextPage + } + } + name + seo { + canonical { + brand { + key + } + } + description + title + } + social { + image { + height + url + width + } + } + } + redirect } - } - page { - ads { - suppress + } + fragment AssetBylineFragment on AssetByline { + type + ... on AssetBylineAuthor { + author { + name + publicId + profile { + avatar + bio + body + canonical { + brand { + key + } + } + email + socials { + facebook { + publicId + } + twitter { + publicId + } + } + title + } + } + } + ... on AssetBylineName { + name + } + } + fragment AssetImagesFragmentAudience on ImageRenditions { + landscape16x9 { + ...ImageFragmentAudience + } + landscape3x2 { + ...ImageFragmentAudience + } + portrait2x3 { + ...ImageFragmentAudience + } + square1x1 { + ...ImageFragmentAudience + } + } + fragment ImageFragmentAudience on ImageRendition { + altText + animated + caption + credit + crop { + offsetX + offsetY + width + zoom + } + mediaId + mimeType + source + type + } + fragment AssetUrlsAudienceFragment on AssetURLs { + canonical { + brand { + key + } + path + } + external { + url + } + published { + brand { + key + } + path + } + } + fragment TagFragmentAudience on Tag { + company { + exchangeCode + stockCode + } + context { + name } description + displayName + externalEntities { + google { + placeId + } + wikipedia { + publicId + url + } + } id - latestStoriesConnection(first: $firstStories, after: $afterStories) { - edges { - node { - byline { - ...AssetBylineFragment - } - headlines { - headline - } - ads { - sponsor { - name - } - } - overview { - about - label - } - type - dates { - firstPublished - published - } - id - publicId - images { - ...AssetImagesFragmentAudience - } - tags { - primary { - ...TagFragmentAudience - } - secondary { - ...TagFragmentAudience - } - } - urls { - ...AssetUrlsAudienceFragment - } - } - } - pageInfo { - endCursor - hasNextPage - } + location { + latitude + longitude + postalCode + state } name + publicId seo { - canonical { - brand { - key + description + title + } + urls { + canonical { + brand { + key + } + path } - } - description - title - } - social { - image { - height - url - width - } - } - } - redirect - } - } - fragment AssetBylineFragment on AssetByline { - type - ... on AssetBylineAuthor { - author { - name - publicId - profile { - avatar - bio - body - canonical { - brand { - key + published { + brand { + key + } + path } - } - email - socials { - facebook { - publicId - } - twitter { - publicId - } - } - title } - } } - ... on AssetBylineName { - name - } - } - fragment AssetImagesFragmentAudience on ImageRenditions { - landscape16x9 { - ...ImageFragmentAudience - } - landscape3x2 { - ...ImageFragmentAudience - } - portrait2x3 { - ...ImageFragmentAudience - } - square1x1 { - ...ImageFragmentAudience - } - } - fragment ImageFragmentAudience on ImageRendition { - altText - animated - caption - credit - crop { - offsetX - offsetY - width - zoom - } - mediaId - mimeType - source - type - } - fragment AssetUrlsAudienceFragment on AssetURLs { - canonical { - brand { - key - } - path - } - external { - url - } - published { - brand { - key - } - path - } - } - fragment TagFragmentAudience on Tag { - company { - exchangeCode - stockCode - } - context { - name - } - description - displayName - externalEntities { - google { - placeId - } - wikipedia { - publicId - url - } - } - id - location { - latitude - longitude - postalCode - state - } - name - publicId - seo { - description - title - } - urls { - canonical { - brand { - key - } - path - } - published { - brand { - key - } - path - } - } - }`; +`; -export const assetsConnectionByCriteriaQuery = /* GraphQL */ `query assetsConnectionByCriteria( - $after: ID - $brand: Brand! - $categories: [Int!] - $first: Int! - $render: Render! - $types: [AssetType!]! - ) { - assetsConnectionByCriteria( - after: $after - brand: $brand - categories: $categories - first: $first - render: $render - types: $types - ) { - edges { - cursor - node { - ...AssetFragment - sponsor { - name - } +export const assetsConnectionByCriteriaQuery = /* GraphQL */ ` + query assetsConnectionByCriteria($after: ID, $brand: Brand!, $categories: [Int!], $first: Int!, $render: Render!, $types: [AssetType!]!) { + assetsConnectionByCriteria(after: $after, brand: $brand, categories: $categories, first: $first, render: $render, types: $types) { + edges { + cursor + node { + ...AssetFragment + sponsor { + name + } + } + } + error { + message + type { + class + } + } + pageInfo { + endCursor + hasNextPage + } } - } - error { - message - type { - class + } + fragment AssetFragment on Asset { + asset { + about + byline + duration + headlines { + headline + } + live } - } - pageInfo { - endCursor - hasNextPage - } - } - } - fragment AssetFragment on Asset { - asset { - about - byline - duration - headlines { - headline - } - live - } - assetType - dates { - firstPublished - modified - published - } - id - featuredImages { - landscape16x9 { - ...ImageFragment - } - landscape3x2 { - ...ImageFragment - } - portrait2x3 { - ...ImageFragment - } - square1x1 { - ...ImageFragment - } - } - label - tags { - primary: primaryTag { - ...AssetTag - } - secondary { - ...AssetTag - } - } - urls { - ...AssetURLs - } - } - fragment AssetTag on AssetTagDetails { - ...AssetTagAudience - shortID - slug - } - fragment AssetTagAudience on AssetTagDetails { - company { - exchangeCode - stockCode - } - context - displayName - id - name - urls { - canonical { - brand - path - } - published { - afr { - path + assetType + dates { + firstPublished + modified + published + } + id + featuredImages { + landscape16x9 { + ...ImageFragment + } + landscape3x2 { + ...ImageFragment + } + portrait2x3 { + ...ImageFragment + } + square1x1 { + ...ImageFragment + } + } + label + tags { + primary: primaryTag { + ...AssetTag + } + secondary { + ...AssetTag + } + } + urls { + ...AssetURLs } - } } - } - fragment AssetURLs on AssetURLs { - canonical { - brand - path + fragment AssetTag on AssetTagDetails { + ...AssetTagAudience + shortID + slug } - published { - afr { - path - } + fragment AssetTagAudience on AssetTagDetails { + company { + exchangeCode + stockCode + } + context + displayName + id + name + urls { + canonical { + brand + path + } + published { + afr { + path + } + } + } } - } - fragment ImageFragment on Image { - data { - altText - aspect - autocrop - caption - cropWidth - id - offsetX - offsetY - zoom + fragment AssetURLs on AssetURLs { + canonical { + brand + path + } + published { + afr { + path + } + } } - }`; + fragment ImageFragment on Image { + data { + altText + aspect + autocrop + caption + cropWidth + id + offsetX + offsetY + zoom + } + } +`; diff --git a/lib/routes/behance/queries.ts b/lib/routes/behance/queries.ts index cc85c54c0a..d33858150f 100644 --- a/lib/routes/behance/queries.ts +++ b/lib/routes/behance/queries.ts @@ -1,1015 +1,1021 @@ -export const getProfileProjectsAndSelectionsQuery = /* GraphQL */ `query GetProfileProjectsAndSections($username: String, $after: String) { - user(username: $username) { - hasPortfolio - profileSections { - ...profileSectionFields - } - profileProjects(first: 12, after: $after) { - pageInfo { - endCursor - hasNextPage +export const getProfileProjectsAndSelectionsQuery = /* GraphQL */ ` + query GetProfileProjectsAndSections($username: String, $after: String) { + user(username: $username) { + hasPortfolio + profileSections { + ...profileSectionFields + } + profileProjects(first: 12, after: $after) { + pageInfo { + endCursor + hasNextPage + } + nodes { + __typename + adminFlags { + mature_lock + privacy_lock + dmca_lock + flagged_lock + privacy_violation_lock + trademark_lock + spam_lock + eu_ip_lock + } + canBeBoosted + colors { + r + g + b + } + covers { + size_202 { + url + } + size_404 { + url + } + size_808 { + url + } + } + features { + url + name + featuredOn + ribbon { + image + image2x + image3x + } + } + fields { + id + label + slug + url + } + hasMatureContent + id + isBoosted + isFeatured + isHiddenFromWorkTab + isMatureReviewSubmitted + isMonaReported + isOwner + isFounder + isPinnedToSubscriptionOverview + isPrivate + sourceFiles { + ...sourceFileWithCoverFields + } + matureAccess + modifiedOn + name + owners { + ...OwnerFields + images { + size_50 { + url + } + } + } + premium + publishedOn + privacyLevel + profileSectionId + stats { + appreciations { + all + } + views { + all + } + comments { + all + } + } + slug + url + } + } } - nodes { - __typename - adminFlags { - mature_lock - privacy_lock - dmca_lock - flagged_lock - privacy_violation_lock - trademark_lock - spam_lock - eu_ip_lock - } - canBeBoosted - colors { - r - g - b - } - covers { - size_202 { - url + viewer { + flags { + hasClickedOnAddProfileSectionButton + hasSeenProfilePortfolioUpsellModal + hasSeenCreatorProIntroModal + lastSeenMarketingPopupTimestamp + onboardedAsHirer } - size_404 { - url - } - size_808 { - url - } - } - features { - url - name - featuredOn - ribbon { - image - image2x - image3x - } - } - fields { - id - label - slug - url - } - hasMatureContent - id - isBoosted - isFeatured - isHiddenFromWorkTab - isMatureReviewSubmitted - isMonaReported - isOwner - isFounder - isPinnedToSubscriptionOverview - isPrivate - sourceFiles { - ...sourceFileWithCoverFields - } - matureAccess - modifiedOn - name - owners { - ...OwnerFields - images { - size_50 { - url - } - } - } - premium - publishedOn - privacyLevel - profileSectionId - stats { - appreciations { - all - } - views { - all - } - comments { - all - } - } - slug - url } - } } - viewer { - flags { - hasClickedOnAddProfileSectionButton - hasSeenProfilePortfolioUpsellModal - hasSeenCreatorProIntroModal - lastSeenMarketingPopupTimestamp - onboardedAsHirer - } - } - } - - fragment sourceFileWithCoverFields on SourceFile { - __typename - sourceFileId - projectId - userId - title - assetId - renditionUrl - mimeType - size - category - licenseType - unitAmount - currency - tier - hidden - extension - hasUserPurchased - description - cover { - coverUrl - coverX - coverY - coverScale - } - } - - fragment OwnerFields on User { - displayName - hasPremiumAccess - id - isFollowing - isProfileOwner - location - locationUrl - url - username - isMessageButtonVisible - availabilityInfo { - availabilityTimeline - isAvailableFullTime - isAvailableFreelance - hiringTimeline { - key - label - } - } - creatorPro { - isActive - initialSubscriptionDate - } - } - - fragment profileSectionFields on ProfileSection { - id - isDefault - name - order - projectCount - userId - }`; -export const getAppreciatedQuery = /* GraphQL */ `query GetAppreciatedProjects($username: String, $after: String) { - user(username: $username) { - appreciatedProjects(first: 24, after: $after) { - nodes { - __typename - colors { - r - g - b - } - covers { - size_202 { - url - } - size_404 { - url - } - size_808 { - url - } - } - slug - id - name - url - owners { - ...OwnerFields - images { - size_50 { - url - } - } - } - stats { - appreciations { - all - } - views { - all - } - } - } - pageInfo { - endCursor - hasNextPage - } - } - } - } - fragment OwnerFields on User { - displayName - hasPremiumAccess - id - isFollowing - isProfileOwner - location - locationUrl - url - username - isMessageButtonVisible - availabilityInfo { - availabilityTimeline - isAvailableFullTime - isAvailableFreelance - hiringTimeline { - key - label - } - } - creatorPro { - isActive - initialSubscriptionDate - } - }`; - -export const getProjectPageQuery = /* GraphQL */ `query ProjectPage($projectId: ProjectId!, $projectPassword: String) { - viewer { - ...Project_Viewer - } - project(id: $projectId) { - id - slug - premium - isPrivate - isOwner - canvasWidth - embedTag - url - stylesInline - ...Project_Project - ...EmbedShareModal_Project - creator { - hasPremiumAccess - } - owners { - id - username - displayName - } - allModules(projectPassword: $projectPassword) { + fragment sourceFileWithCoverFields on SourceFile { __typename - } + sourceFileId + projectId + userId + title + assetId + renditionUrl + mimeType + size + category + licenseType + unitAmount + currency + tier + hidden + extension + hasUserPurchased + description + cover { + coverUrl + coverX + coverY + coverScale + } } - } - fragment Avatar_UserImageSizes on UserImageSizes { - ...AvatarImage_UserImageSizes - } - fragment Avatar_User on User { - id - url - images { - ...Avatar_UserImageSizes - } - creatorPro { - isActive - } - ...CreatorProBadge_User - } - fragment AvatarImage_UserImageSizes on UserImageSizes { - allAvailable { - url - width - type - } - } - fragment CreatorProBadge_User on User { - creatorPro { - initialSubscriptionDate - } - } - fragment EmbedShareModal_Project on Project { - ...EmbedShareProjectCover_Project - } - fragment Feature_ProjectFeature on ProjectFeature { - url - name - featuredOn - ribbon { - image - image2x - } - } - fragment HireOverlay_User on User { - id - firstName - isResponsiveToHiring - isMessageButtonVisible - ...Avatar_User - ...WideMessageButton_User - availabilityInfo { - hiringTimeline { - key - } - } - } - fragment ProjectInfoBox_User on User { - id - displayName - url - isFollowing - ...MultipleOwners_User - } - fragment ProjectInfoBox_Project on Project { - id - name - url - isOwner - covers { - allAvailable { - url - width - type - } - } - owners { - ...ProjectInfoBox_User - } - } - fragment SourceAssetsPane_SourceFile on SourceFile { - ...SourceFileRowsContainer_SourceFile - } - fragment SourceFileRowsContainer_SourceFile on SourceFile { - tier - hasUserPurchased - ...SourceFileRow_SourceFile - } - fragment UserInfo_User on User { - displayName - id - location - locationUrl - url - country - isProfileOwner - city - state - creatorPro { - isActive - } - ...Avatar_User - } - fragment UsersTooltip_User on User { - displayName - id - isFollowing - isProfileOwner - availabilityInfo { - isAvailableFullTime - isAvailableFreelance - } - ...UserInfo_User - } - fragment DominantColor_Colors on Colors { - r - g - b - } - fragment Tools_Tool on Tool { - id - title - url - backgroundImage { - size_original { - url - } - } - backgroundColor - synonym { - tagId - name - title - downloadUrl - iconUrl - } - } - fragment HireMeForm_UserAvailabilityInfo on UserAvailabilityInfo { - isAvailableFreelance - isAvailableFullTime - budgetMin - currency - compensationMin - hiringTimeline { - key - } - } - fragment MessageDialogManager_User on User { - id - displayName - username - images { - ...AvatarImage_UserImageSizes - } - creatorPro { - isActive - } - ...SendRegularMessagePane_User - ...ServicesPane_User - } - fragment SendRegularMessagePane_User on User { - displayName - availabilityInfo { - ...HireMeForm_UserAvailabilityInfo - } - } - fragment ServicesPane_User on User { - id - displayName - ...InquireServiceModal_User - ...ViewServiceInfoModal_User - } - fragment MessageManager_User on User { - id - isMessageButtonVisible - displayName - username - ...MessageDialogManager_User - availabilityInfo { - availabilityTimeline - isAvailableFullTime - isAvailableFreelance - hiringTimeline { - key - } - } - } - fragment WideMessageButton_User on User { - firstName - ...MessageManager_User - } - fragment AppreciationNotification_Viewer on Viewer { - url - } - fragment Avatar_Project_User on User { - id - ...Avatar_User - } - fragment ImageElement_ImageModule on ImageModule { - id - altText - height - width - fullBleed - imageSizes { - allAvailable(type: [JPG, WEBP]) { - url - width - height - type - } - size_max_158 { - url - } - } - } - fragment Module_ProjectModule on ProjectModule { - ...Embed_ProjectModule - ... on AudioModule { - id - caption - captionAlignment - } - ... on VideoModule { - id - caption - captionAlignment - } - ... on EmbedModule { - id - caption - captionAlignment - } - ... on ImageModule { - id - ...ThreeD_ImageModule - ...SingleImage_ImageModule - ...Image_ImageModule - } - ... on MediaCollectionModule { - id - caption: captionPlain - captionAlignment - components { - ...Actions_MediaCollectionComponent - filename - flexHeight - flexWidth - height - width + + fragment OwnerFields on User { + displayName + hasPremiumAccess id - imageSizes { - allAvailable(type: [JPG, WEBP]) { + isFollowing + isProfileOwner + location + locationUrl + url + username + isMessageButtonVisible + availabilityInfo { + availabilityTimeline + isAvailableFullTime + isAvailableFreelance + hiringTimeline { + key + label + } + } + creatorPro { + isActive + initialSubscriptionDate + } + } + + fragment profileSectionFields on ProfileSection { + id + isDefault + name + order + projectCount + userId + } +`; + +export const getAppreciatedQuery = /* GraphQL */ ` + query GetAppreciatedProjects($username: String, $after: String) { + user(username: $username) { + appreciatedProjects(first: 24, after: $after) { + nodes { + __typename + colors { + r + g + b + } + covers { + size_202 { + url + } + size_404 { + url + } + size_808 { + url + } + } + slug + id + name + url + owners { + ...OwnerFields + images { + size_50 { + url + } + } + } + stats { + appreciations { + all + } + views { + all + } + } + } + pageInfo { + endCursor + hasNextPage + } + } + } + } + fragment OwnerFields on User { + displayName + hasPremiumAccess + id + isFollowing + isProfileOwner + location + locationUrl + url + username + isMessageButtonVisible + availabilityInfo { + availabilityTimeline + isAvailableFullTime + isAvailableFreelance + hiringTimeline { + key + label + } + } + creatorPro { + isActive + initialSubscriptionDate + } + } +`; + +export const getProjectPageQuery = /* GraphQL */ ` + query ProjectPage($projectId: ProjectId!, $projectPassword: String) { + viewer { + ...Project_Viewer + } + project(id: $projectId) { + id + slug + premium + isPrivate + isOwner + canvasWidth + embedTag + url + stylesInline + ...Project_Project + ...EmbedShareModal_Project + creator { + hasPremiumAccess + } + owners { + id + username + displayName + } + allModules(projectPassword: $projectPassword) { + __typename + } + } + } + fragment Avatar_UserImageSizes on UserImageSizes { + ...AvatarImage_UserImageSizes + } + fragment Avatar_User on User { + id + url + images { + ...Avatar_UserImageSizes + } + creatorPro { + isActive + } + ...CreatorProBadge_User + } + fragment AvatarImage_UserImageSizes on UserImageSizes { + allAvailable { url width - height type - } } - } - fullBleed } - ... on TextModule { - id - text - alignment + fragment CreatorProBadge_User on User { + creatorPro { + initialSubscriptionDate + } } - } - fragment MultipleOwners_User on User { - ...UsersTooltip_User - } - fragment MultipleOwners_Project on Project { - id - name - } - fragment Project_Owners_User on User { - id - displayName - username - firstName - url - isFollowing - isMessageButtonVisible - isCreatorPro - creatorPro { - isActive + fragment EmbedShareModal_Project on Project { + ...EmbedShareProjectCover_Project } - ...UsersTooltip_User - ...MultipleOwners_User - ...Avatar_Project_User - ...Avatar_User - ...HireOverlay_User - } - fragment Project_Creator_User on User { - id - isProfileOwner - isFollowing - hasPremiumAccess - hasAllowEmbeds - url - ...PaneHeader_User - } - fragment Project_ProjectCoverImageSizes on ProjectCoverImageSizes { - allAvailable { - url - width - type - } - } - fragment Project_Tool on Tool { - ...Tools_Tool - } - fragment Project_SourceFile on SourceFile { - ...SourceFileRowsContainer_SourceFile - ...SourceFilesProjectOverlay_SourceFile - ...ProjectExtras_SourceFile - } - fragment Project_ProjectFeature on ProjectFeature { - ...Feature_ProjectFeature - } - fragment Project_Project on Project { - id - slug - name - url - description - tags { - id - title - } - privacyLevel - matureAccess - canvasWidth - isOwner - hasMatureContent - isPrivate - publishedOn - canBeAddedToMoodboard - isMonaReported - isAppreciated - projectCTA { - ctaType - link { - description + fragment Feature_ProjectFeature on ProjectFeature { url + name + featuredOn + ribbon { + image + image2x + } + } + fragment HireOverlay_User on User { + id + firstName + isResponsiveToHiring + isMessageButtonVisible + ...Avatar_User + ...WideMessageButton_User + availabilityInfo { + hiringTimeline { + key + } + } + } + fragment ProjectInfoBox_User on User { + id + displayName + url + isFollowing + ...MultipleOwners_User + } + fragment ProjectInfoBox_Project on Project { + id + name + url + isOwner + covers { + allAvailable { + url + width + type + } + } + owners { + ...ProjectInfoBox_User + } + } + fragment SourceAssetsPane_SourceFile on SourceFile { + ...SourceFileRowsContainer_SourceFile + } + fragment SourceFileRowsContainer_SourceFile on SourceFile { + tier + hasUserPurchased + ...SourceFileRow_SourceFile + } + fragment UserInfo_User on User { + displayName + id + location + locationUrl + url + country + isProfileOwner + city + state + creatorPro { + isActive + } + ...Avatar_User + } + fragment UsersTooltip_User on User { + displayName + id + isFollowing + isProfileOwner + availabilityInfo { + isAvailableFullTime + isAvailableFreelance + } + ...UserInfo_User + } + fragment DominantColor_Colors on Colors { + r + g + b + } + fragment Tools_Tool on Tool { + id title - } - isDefaultCTA + url + backgroundImage { + size_original { + url + } + } + backgroundColor + synonym { + tagId + name + title + downloadUrl + iconUrl + } } - ...MultipleOwners_Project - ...ProjectInfoBox_Project - ...ProjectLightbox_Project - ...ProjectExtras_Project - covers { - ...Project_ProjectCoverImageSizes + fragment HireMeForm_UserAvailabilityInfo on UserAvailabilityInfo { + isAvailableFreelance + isAvailableFullTime + budgetMin + currency + compensationMin + hiringTimeline { + key + } } - sourceFiles { - ...Project_SourceFile - } - creator { - ...Project_Creator_User - } - owners { - ...Project_Owners_User - } - tools { - ...Project_Tool - } - allModules(projectPassword: $projectPassword) { - ... on AudioModule { + fragment MessageDialogManager_User on User { id + displayName + username + images { + ...AvatarImage_UserImageSizes + } + creatorPro { + isActive + } + ...SendRegularMessagePane_User + ...ServicesPane_User + } + fragment SendRegularMessagePane_User on User { + displayName + availabilityInfo { + ...HireMeForm_UserAvailabilityInfo + } + } + fragment ServicesPane_User on User { + id + displayName + ...InquireServiceModal_User + ...ViewServiceInfoModal_User + } + fragment MessageManager_User on User { + id + isMessageButtonVisible + displayName + username + ...MessageDialogManager_User + availabilityInfo { + availabilityTimeline + isAvailableFullTime + isAvailableFreelance + hiringTimeline { + key + } + } + } + fragment WideMessageButton_User on User { + firstName + ...MessageManager_User + } + fragment AppreciationNotification_Viewer on Viewer { + url + } + fragment Avatar_Project_User on User { + id + ...Avatar_User + } + fragment ImageElement_ImageModule on ImageModule { + id + altText + height + width fullBleed - caption - } - ... on EmbedModule { - id - caption - } - ... on ImageModule { - id - fullBleed - caption imageSizes { - size_disp { - url - } - size_disp_still { - url - } - } - ...Actions_ImageModule - } - ... on MediaCollectionModule { - id - fullBleed - caption: captionPlain - components { - id - imageSizes { - size_disp { - url + allAvailable(type: [JPG, WEBP]) { + url + width + height + type } - size_disp_still { - url + size_max_158 { + url } - } - ...Actions_MediaCollectionComponent } - } - ... on TextModule { + } + fragment Module_ProjectModule on ProjectModule { + ...Embed_ProjectModule + ... on AudioModule { + id + caption + captionAlignment + } + ... on VideoModule { + id + caption + captionAlignment + } + ... on EmbedModule { + id + caption + captionAlignment + } + ... on ImageModule { + id + ...ThreeD_ImageModule + ...SingleImage_ImageModule + ...Image_ImageModule + } + ... on MediaCollectionModule { + id + caption: captionPlain + captionAlignment + components { + ...Actions_MediaCollectionComponent + filename + flexHeight + flexWidth + height + width + id + imageSizes { + allAvailable(type: [JPG, WEBP]) { + url + width + height + type + } + } + } + fullBleed + } + ... on TextModule { + id + text + alignment + } + } + fragment MultipleOwners_User on User { + ...UsersTooltip_User + } + fragment MultipleOwners_Project on Project { id - fullBleed - } - ... on VideoModule { + name + } + fragment Project_Owners_User on User { id + displayName + username + firstName + url + isFollowing + isMessageButtonVisible + isCreatorPro + creatorPro { + isActive + } + ...UsersTooltip_User + ...MultipleOwners_User + ...Avatar_Project_User + ...Avatar_User + ...HireOverlay_User + } + fragment Project_Creator_User on User { + id + isProfileOwner + isFollowing + hasPremiumAccess + hasAllowEmbeds + url + ...PaneHeader_User + } + fragment Project_ProjectCoverImageSizes on ProjectCoverImageSizes { + allAvailable { + url + width + type + } + } + fragment Project_Tool on Tool { + ...Tools_Tool + } + fragment Project_SourceFile on SourceFile { + ...SourceFileRowsContainer_SourceFile + ...SourceFilesProjectOverlay_SourceFile + ...ProjectExtras_SourceFile + } + fragment Project_ProjectFeature on ProjectFeature { + ...Feature_ProjectFeature + } + fragment Project_Project on Project { + id + slug + name + url + description + tags { + id + title + } + privacyLevel + matureAccess + canvasWidth + isOwner + hasMatureContent + isPrivate + publishedOn + canBeAddedToMoodboard + isMonaReported + isAppreciated + projectCTA { + ctaType + link { + description + url + title + } + isDefaultCTA + } + ...MultipleOwners_Project + ...ProjectInfoBox_Project + ...ProjectLightbox_Project + ...ProjectExtras_Project + covers { + ...Project_ProjectCoverImageSizes + } + sourceFiles { + ...Project_SourceFile + } + creator { + ...Project_Creator_User + } + owners { + ...Project_Owners_User + } + tools { + ...Project_Tool + } + allModules(projectPassword: $projectPassword) { + ... on AudioModule { + id + fullBleed + caption + } + ... on EmbedModule { + id + caption + } + ... on ImageModule { + id + fullBleed + caption + imageSizes { + size_disp { + url + } + size_disp_still { + url + } + } + ...Actions_ImageModule + } + ... on MediaCollectionModule { + id + fullBleed + caption: captionPlain + components { + id + imageSizes { + size_disp { + url + } + size_disp_still { + url + } + } + ...Actions_MediaCollectionComponent + } + } + ... on TextModule { + id + fullBleed + } + ... on VideoModule { + id + fullBleed + caption + } + ...Module_ProjectModule + } + aeroData { + externalUrl + } + adminNotices { + title + body + isReviewable + } + license { + license + } + features { + ...Project_ProjectFeature + } + stats { + appreciations { + all + } + views { + all + } + } + styles { + spacing { + projectTopMargin + } + } + colors { + r + g + b + } + } + fragment Project_Viewer on Viewer { + stats { + appreciations + } + pulsePoints { + displayFollow + displayAppreciate + } + flags { + hasSeenCreatorProIntroModal + onboardedAsHirer + } + creatorPro { + isActive + } + createdOn + ...AppreciationNotification_Viewer + ...ProjectExtras_Viewer + } + fragment ProjectComments_Viewer on Viewer { + ...ProjectCommentInput_Viewer + id + } + fragment ProjectCommentInput_Viewer on Viewer { + url + images { + size_50 { + url + } + } + } + fragment ProjectExtras_SourceFile on SourceFile { + ...ProjectInfo_SourceFile + } + fragment ProjectExtras_Project on Project { + isCommentingAllowed + } + fragment ProjectExtras_Viewer on Viewer { + ...ProjectInfo_Viewer + } + fragment ProjectInfo_SourceFile on SourceFile { + ...SourceAssetsPane_SourceFile + } + fragment ProjectInfo_Viewer on Viewer { + id + ...ProjectComments_Viewer + } + fragment ProjectLightbox_Project on Project { + id + slug + isOwner + ...ProjectInfoBox_Project + } + fragment SourceFilesProjectOverlay_SourceFile on SourceFile { + hasUserPurchased + ...SourceFileRow_SourceFile + } + fragment Video_VideoDisplay on VideoModule { + captionPlain + embed + height + id + width + } + fragment Actions_ImageModule on ImageModule { + id + hasCaiData + projectId + src + width + projectId + exifData { + lens { + ...Actions_exifDataValue + } + software { + ...Actions_exifDataValue + } + makeAndModel { + ...Actions_exifDataValue + } + focalLength { + ...Actions_exifDataValue + } + iso { + ...Actions_exifDataValue + } + location { + ...Actions_exifDataValue + } + flash { + ...Actions_exifDataValue + } + exposureMode { + ...Actions_exifDataValue + } + shutterSpeed { + ...Actions_exifDataValue + } + aperture { + ...Actions_exifDataValue + } + } + } + fragment Actions_exifDataValue on exifDataValue { + id + searchValue + label + value + } + fragment Actions_MediaCollectionComponent on MediaCollectionComponent { + id + } + fragment Audio_AudioModule on AudioModule { + captionPlain + embed fullBleed + id + } + fragment Embed_ProjectModule on ProjectModule { + ... on EmbedModule { + ...ExternalEmbed_EmbedModule + } + ... on AudioModule { + isDoneProcessing + ...Audio_AudioModule + } + ... on VideoModule { + isDoneProcessing + ...Video_VideoModule + } + } + fragment ExternalEmbed_EmbedModule on EmbedModule { + captionPlain + fluidEmbed + embedModuleFullBleed: fullBleed + height + id + originalEmbed + originalHeight + originalWidth + width + widthUnit + } + fragment Image_ImageModule on ImageModule { + id caption - } - ...Module_ProjectModule - } - aeroData { - externalUrl - } - adminNotices { - title - body - isReviewable - } - license { - license - } - features { - ...Project_ProjectFeature - } - stats { - appreciations { - all - } - views { - all - } - } - styles { - spacing { - projectTopMargin - } - } - colors { - r - g - b - } - } - fragment Project_Viewer on Viewer { - stats { - appreciations - } - pulsePoints { - displayFollow - displayAppreciate - } - flags { - hasSeenCreatorProIntroModal - onboardedAsHirer - } - creatorPro { - isActive - } - createdOn - ...AppreciationNotification_Viewer - ...ProjectExtras_Viewer - } - fragment ProjectComments_Viewer on Viewer { - ...ProjectCommentInput_Viewer - id - } - fragment ProjectCommentInput_Viewer on Viewer { - url - images { - size_50 { - url - } - } - } - fragment ProjectExtras_SourceFile on SourceFile { - ...ProjectInfo_SourceFile - } - fragment ProjectExtras_Project on Project { - isCommentingAllowed - } - fragment ProjectExtras_Viewer on Viewer { - ...ProjectInfo_Viewer - } - fragment ProjectInfo_SourceFile on SourceFile { - ...SourceAssetsPane_SourceFile - } - fragment ProjectInfo_Viewer on Viewer { - id - ...ProjectComments_Viewer - } - fragment ProjectLightbox_Project on Project { - id - slug - isOwner - ...ProjectInfoBox_Project - } - fragment SourceFilesProjectOverlay_SourceFile on SourceFile { - hasUserPurchased - ...SourceFileRow_SourceFile - } - fragment Video_VideoDisplay on VideoModule { - captionPlain - embed - height - id - width - } - fragment Actions_ImageModule on ImageModule { - id - hasCaiData - projectId - src - width - projectId - exifData { - lens { - ...Actions_exifDataValue - } - software { - ...Actions_exifDataValue - } - makeAndModel { - ...Actions_exifDataValue - } - focalLength { - ...Actions_exifDataValue - } - iso { - ...Actions_exifDataValue - } - location { - ...Actions_exifDataValue - } - flash { - ...Actions_exifDataValue - } - exposureMode { - ...Actions_exifDataValue - } - shutterSpeed { - ...Actions_exifDataValue - } - aperture { - ...Actions_exifDataValue - } - } - } - fragment Actions_exifDataValue on exifDataValue { - id - searchValue - label - value - } - fragment Actions_MediaCollectionComponent on MediaCollectionComponent { - id - } - fragment Audio_AudioModule on AudioModule { - captionPlain - embed - fullBleed - id - } - fragment Embed_ProjectModule on ProjectModule { - ... on EmbedModule { - ...ExternalEmbed_EmbedModule - } - ... on AudioModule { - isDoneProcessing - ...Audio_AudioModule - } - ... on VideoModule { - isDoneProcessing - ...Video_VideoModule - } - } - fragment ExternalEmbed_EmbedModule on EmbedModule { - captionPlain - fluidEmbed - embedModuleFullBleed: fullBleed - height - id - originalEmbed - originalHeight - originalWidth - width - widthUnit - } - fragment Image_ImageModule on ImageModule { - id - caption - captionAlignment - fullBleed - height - width - altText - ...Actions_ImageModule - ...ImageElement_ImageModule - } - fragment SingleImage_ImageModule on ImageModule { - id - caption - captionAlignment - fullBleed - height - width - ...Actions_ImageModule - ...ImageElement_ImageModule - } - fragment ThreeD_ImageModule on ImageModule { - id - altText - threeDData { - iframeUrl - } - } - fragment Video_VideoModule on VideoModule { - fullBleed - id - ...Video_VideoDisplay - } - fragment Avatar_EmbedFragment on User { - id - images { - allAvailable { - url + captionAlignment + fullBleed + height width - } + altText + ...Actions_ImageModule + ...ImageElement_ImageModule } - displayName - } - fragment EmbedShareProjectCover_SourceFile on SourceFile { - ...PaidAndFreeAssetsCountBadge_Embed_SourceFile - } - fragment EmbedShareProjectCover_User on User { - ...Avatar_EmbedFragment - } - fragment EmbedShareProjectCover_Project on Project { - id - isPrivate - isPublished - hasMatureContent - creator { - hasAllowEmbeds - } - colors { - ...DominantColor_Colors - } - sourceFiles { - ...EmbedShareProjectCover_SourceFile - } - name - url - covers { - allAvailable { - url + fragment SingleImage_ImageModule on ImageModule { + id + caption + captionAlignment + fullBleed + height width - type - } - size_original_webp { + ...Actions_ImageModule + ...ImageElement_ImageModule + } + fragment ThreeD_ImageModule on ImageModule { + id + altText + threeDData { + iframeUrl + } + } + fragment Video_VideoModule on VideoModule { + fullBleed + id + ...Video_VideoDisplay + } + fragment Avatar_EmbedFragment on User { + id + images { + allAvailable { + url + width + } + } + displayName + } + fragment EmbedShareProjectCover_SourceFile on SourceFile { + ...PaidAndFreeAssetsCountBadge_Embed_SourceFile + } + fragment EmbedShareProjectCover_User on User { + ...Avatar_EmbedFragment + } + fragment EmbedShareProjectCover_Project on Project { + id + isPrivate + isPublished + hasMatureContent + creator { + hasAllowEmbeds + } + colors { + ...DominantColor_Colors + } + sourceFiles { + ...EmbedShareProjectCover_SourceFile + } + name url - width - type - } + covers { + allAvailable { + url + width + type + } + size_original_webp { + url + width + type + } + } + owners { + url + ...EmbedShareProjectCover_User + } } - owners { - url - ...EmbedShareProjectCover_User + fragment PaidAndFreeAssetsCountBadge_Embed_SourceFile on SourceFile { + unitAmount + tier + hidden } - } - fragment PaidAndFreeAssetsCountBadge_Embed_SourceFile on SourceFile { - unitAmount - tier - hidden - } - fragment ViewServiceInfoModal_User on User { - id - displayName - url - images { - size_50 { + fragment ViewServiceInfoModal_User on User { + id + displayName url - } + images { + size_50 { + url + } + } + creatorPro { + isActive + } + ...CreatorProBadge_User } - creatorPro { - isActive + fragment InquireServiceModal_User on User { + id + displayName + images { + size_50 { + url + } + } + availabilityInfo { + hiringTimeline { + key + } + } } - ...CreatorProBadge_User - } - fragment InquireServiceModal_User on User { - id - displayName - images { - size_50 { + fragment SourceFileRow_SourceFile on SourceFile { + assetId + cover { + coverUrl + } + title + extension + currency + unitAmount + renditionUrl + hasUserPurchased + tier + sourceFileId + projectId + mimeType + category + licenseType + size + } + fragment PaneHeader_User on User { + id url - } + displayName + images { + allAvailable { + width + url + type + } + } } - availabilityInfo { - hiringTimeline { - key - } - } - } - fragment SourceFileRow_SourceFile on SourceFile { - assetId - cover { - coverUrl - } - title - extension - currency - unitAmount - renditionUrl - hasUserPurchased - tier - sourceFileId - projectId - mimeType - category - licenseType - size - } - fragment PaneHeader_User on User { - id - url - displayName - images { - allAvailable { - width - url - type - } - } - }`; +`; diff --git a/lib/routes/fantube/utils.ts b/lib/routes/fantube/utils.ts index 6c312bf43f..7053bbb0d1 100644 --- a/lib/routes/fantube/utils.ts +++ b/lib/routes/fantube/utils.ts @@ -39,227 +39,221 @@ export const getCreatorPostReelList = (identifier: string, limit: number): Promi Referer: baseUrl, }, body: JSON.stringify({ - query: /* GraphQL */ `query CreatorPostReelList($identifier: String!, $first: Int, $after: String, $last: Int, $before: String) { - posts( - where: {status: {equals: PUBLISHED}, creator: {is: {identifier: {equals: $identifier}}}} - orderBy: [{pinnedAt: {nulls: last, sort: desc}}, {order: asc}, {createdAt: desc}, {id: desc}] - first: $first - after: $after - last: $last - before: $before - ) { - nodes { - ...PostSwiper_Post - } - pageInfo { - hasNextPage - endCursor - hasPreviousPage - startCursor - } - } -} + query: /* GraphQL */ ` + query CreatorPostReelList($identifier: String!, $first: Int, $after: String, $last: Int, $before: String) { + posts( + where: { status: { equals: PUBLISHED }, creator: { is: { identifier: { equals: $identifier } } } } + orderBy: [{ pinnedAt: { nulls: last, sort: desc } }, { order: asc }, { createdAt: desc }, { id: desc }] + first: $first + after: $after + last: $last + before: $before + ) { + nodes { + ...PostSwiper_Post + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } -fragment PostSwiper_Post on Post { - id - title - isFavorite - favoritesCount - ...PostSwiperSlide_Post -} + fragment PostSwiper_Post on Post { + id + title + isFavorite + favoritesCount + ...PostSwiperSlide_Post + } -fragment PostSwiperSlide_Post on Post { - id - type - title - price - creator { - displayName - } - ...PostVideoElement_Post - ...PostImageElement_Post -} + fragment PostSwiperSlide_Post on Post { + id + type + title + price + creator { + displayName + } + ...PostVideoElement_Post + ...PostImageElement_Post + } -fragment PostVideoElement_Post on Post { - id - title - contentData { - ... on PostVideoType { - __typename - videoUrl - isSample - noSample - durationSeconds - } - } - isFavorite - sampleVideoId - thumbnailUrl - creator { - displayName - } - ...PostInfo_Post - ...VideoControlIcons_Post - ...PurchaseWrapper_Post -} + fragment PostVideoElement_Post on Post { + id + title + contentData { + ... on PostVideoType { + __typename + videoUrl + isSample + noSample + durationSeconds + } + } + isFavorite + sampleVideoId + thumbnailUrl + creator { + displayName + } + ...PostInfo_Post + ...VideoControlIcons_Post + ...PurchaseWrapper_Post + } -fragment PostInfo_Post on Post { - title - description - publishStartAt - price - isBuyEnabled - ...Profile_Post -} + fragment PostInfo_Post on Post { + title + description + publishStartAt + price + isBuyEnabled + ...Profile_Post + } -fragment Profile_Post on Post { - id - creator { - id - isSelf - identifier - displayName - avatarImageUrl - following - } -} + fragment Profile_Post on Post { + id + creator { + id + isSelf + identifier + displayName + avatarImageUrl + following + } + } -fragment VideoControlIcons_Post on Post { - id - isMine - pinnedAt - favoritesCount - ...PostComment_Post -} + fragment VideoControlIcons_Post on Post { + id + isMine + pinnedAt + favoritesCount + ...PostComment_Post + } -fragment PostComment_Post on Post { - id - isMine - canComment - comments( - where: {OR: [{parentPostComment: {is: {isDeleted: {equals: false}}}}, {parentPostCommentId: {equals: null}}], isDeleted: {equals: false}} - ) { - totalCount - } - ...PostCommentReplyDrawer_Post -} + fragment PostComment_Post on Post { + id + isMine + canComment + comments(where: { OR: [{ parentPostComment: { is: { isDeleted: { equals: false } } } }, { parentPostCommentId: { equals: null } }], isDeleted: { equals: false } }) { + totalCount + } + ...PostCommentReplyDrawer_Post + } -fragment PostCommentReplyDrawer_Post on Post { - id - isMine - canComment -} + fragment PostCommentReplyDrawer_Post on Post { + id + isMine + canComment + } -fragment PurchaseWrapper_Post on Post { - id - title - price - creator { - displayName - } - ...PostPurchaseDialog_Post - ...PostPurchaseSingleDialog_Post -} + fragment PurchaseWrapper_Post on Post { + id + title + price + creator { + displayName + } + ...PostPurchaseDialog_Post + ...PostPurchaseSingleDialog_Post + } -fragment PostPurchaseDialog_Post on Post { - id - isBuyEnabled - price - thumbnailUrl - title - planPosts( - orderBy: [{plan: {deleteRequestAt: {sort: desc, nulls: first}}}, {plan: {isRecommended: desc}}, {plan: {price: asc}}] - ) { - nodes { - plan { - id - title - price - ...PlanSwiper_Plan - } - } - } - creator { - displayName - } - ...PostPurchaseSingleDialog_Post -} + fragment PostPurchaseDialog_Post on Post { + id + isBuyEnabled + price + thumbnailUrl + title + planPosts(orderBy: [{ plan: { deleteRequestAt: { sort: desc, nulls: first } } }, { plan: { isRecommended: desc } }, { plan: { price: asc } }]) { + nodes { + plan { + id + title + price + ...PlanSwiper_Plan + } + } + } + creator { + displayName + } + ...PostPurchaseSingleDialog_Post + } -fragment PlanSwiper_Plan on Plan { - id - ...PlanSwiperItem_Plan -} + fragment PlanSwiper_Plan on Plan { + id + ...PlanSwiperItem_Plan + } -fragment PlanSwiperItem_Plan on Plan { - id - title - price - isArchive - isRecommended - deleteRequestAt - isSubscribing - subscriptionCloseAt - capacity - subscribersCount - planPosts( - where: {post: {is: {status: {equals: PUBLISHED}}}} - first: 7 - orderBy: [{createdAt: desc}] - ) { - nodes { - post { - id - thumbnailUrl - title - } - } - totalCount - } - ...PlanUnavailableNote_Plan -} + fragment PlanSwiperItem_Plan on Plan { + id + title + price + isArchive + isRecommended + deleteRequestAt + isSubscribing + subscriptionCloseAt + capacity + subscribersCount + planPosts(where: { post: { is: { status: { equals: PUBLISHED } } } }, first: 7, orderBy: [{ createdAt: desc }]) { + nodes { + post { + id + thumbnailUrl + title + } + } + totalCount + } + ...PlanUnavailableNote_Plan + } -fragment PlanUnavailableNote_Plan on Plan { - capacity - subscribersCount - subscriptionCloseAt - deleteRequestAt -} + fragment PlanUnavailableNote_Plan on Plan { + capacity + subscribersCount + subscriptionCloseAt + deleteRequestAt + } -fragment PostPurchaseSingleDialog_Post on Post { - id - price - thumbnailUrl - title - isBuyEnabled -} + fragment PostPurchaseSingleDialog_Post on Post { + id + price + thumbnailUrl + title + isBuyEnabled + } -fragment PostImageElement_Post on Post { - id - title - contentData { - __typename - ... on PostImageType { - encrypted - imageUrls - count - } - } - isFavorite - creator { - displayName - } - ...PostInfo_Post - ...ImageControlIcons_Post - ...PurchaseWrapper_Post -} + fragment PostImageElement_Post on Post { + id + title + contentData { + __typename + ... on PostImageType { + encrypted + imageUrls + count + } + } + isFavorite + creator { + displayName + } + ...PostInfo_Post + ...ImageControlIcons_Post + ...PurchaseWrapper_Post + } -fragment ImageControlIcons_Post on Post { - id - isMine - pinnedAt - favoritesCount - ...PostComment_Post -}`, + fragment ImageControlIcons_Post on Post { + id + isMine + pinnedAt + favoritesCount + ...PostComment_Post + } + `, variables: { identifier, first: limit, after: '' }, operationName: 'CreatorPostReelList', }), diff --git a/lib/routes/komiic/comic.ts b/lib/routes/komiic/comic.ts index a4d964be12..f705feb4fa 100644 --- a/lib/routes/komiic/comic.ts +++ b/lib/routes/komiic/comic.ts @@ -36,12 +36,14 @@ async function handler(ctx) { json: { operationName: 'comicById', variables: { comicId: id }, - query: /* GraphQL */ `query comicById($comicId: ID!) { - comicById(comicId: $comicId) { - title - imageUrl + query: /* GraphQL */ ` + query comicById($comicId: ID!) { + comicById(comicId: $comicId) { + title + imageUrl + } } - }`, + `, }, }); @@ -51,15 +53,17 @@ async function handler(ctx) { json: { operationName: 'chapterByComicId', variables: { comicId: id }, - query: /* GraphQL */ `query chapterByComicId($comicId: ID!) { - chaptersByComicId(comicId: $comicId) { - id - serial - type - dateUpdated - size + query: /* GraphQL */ ` + query chapterByComicId($comicId: ID!) { + chaptersByComicId(comicId: $comicId) { + id + serial + type + dateUpdated + size + } } - }`, + `, }, }); diff --git a/lib/routes/leetcode/articles.ts b/lib/routes/leetcode/articles.ts index c3c536f399..f9d37e335c 100644 --- a/lib/routes/leetcode/articles.ts +++ b/lib/routes/leetcode/articles.ts @@ -66,13 +66,15 @@ async function handler() { body: { operationName: 'questionContent', variables: { titleSlug }, - query: /* GraphQL */ `query questionContent($titleSlug: String!) { + query: /* GraphQL */ ` + query questionContent($titleSlug: String!) { question(titleSlug: $titleSlug) { content mysqlSchemas dataSchemas } - }`, + } + `, }, }); @@ -81,13 +83,15 @@ async function handler() { body: { operationName: 'officialSolution', variables: { titleSlug }, - query: /* GraphQL */ `query officialSolution($titleSlug: String!) { + query: /* GraphQL */ ` + query officialSolution($titleSlug: String!) { question(titleSlug: $titleSlug) { solution { content } } - }`, + } + `, }, }); diff --git a/lib/routes/leetcode/dailyquestion-cn.ts b/lib/routes/leetcode/dailyquestion-cn.ts index e714f884a0..d7c27389a5 100644 --- a/lib/routes/leetcode/dailyquestion-cn.ts +++ b/lib/routes/leetcode/dailyquestion-cn.ts @@ -30,15 +30,17 @@ async function handler() { }; const url = host + '/graphql'; const dailyQuestionPayload = { - query: /* GraphQL */ `query questionOfToday { - todayRecord { - date - question { - frontendQuestionId: questionFrontendId - titleSlug + query: /* GraphQL */ ` + query questionOfToday { + todayRecord { + date + question { + frontendQuestionId: questionFrontendId + titleSlug + } } } - } `, + `, variables: {}, }; const dailyQuestionResponse = await got({ @@ -56,25 +58,27 @@ async function handler() { const detailsPayload = { operationName: 'questionData', - query: /* GraphQL */ `query questionData($titleSlug: String!) { - question(titleSlug: $titleSlug) { - questionId - questionFrontendId - title - titleSlug - content - translatedTitle - translatedContent - difficulty - topicTags { - name - slug - translatedName + query: /* GraphQL */ ` + query questionData($titleSlug: String!) { + question(titleSlug: $titleSlug) { + questionId + questionFrontendId + title + titleSlug + content + translatedTitle + translatedContent + difficulty + topicTags { + name + slug + translatedName + __typename + } __typename } - __typename } - }`, + `, variables: { titleSlug: question.titleSlug, }, diff --git a/lib/routes/leetcode/dailyquestion-en.ts b/lib/routes/leetcode/dailyquestion-en.ts index e4f9f6c025..9d6df03ae0 100644 --- a/lib/routes/leetcode/dailyquestion-en.ts +++ b/lib/routes/leetcode/dailyquestion-en.ts @@ -30,16 +30,18 @@ async function handler() { }; const url = host + '/graphql'; const dailyQuestionPayload = { - query: /* GraphQL */ `query questionOfToday { - activeDailyCodingChallengeQuestion { - date - link - question { - frontendQuestionId: questionFrontendId - titleSlug + query: /* GraphQL */ ` + query questionOfToday { + activeDailyCodingChallengeQuestion { + date + link + question { + frontendQuestionId: questionFrontendId + titleSlug + } } } - } `, + `, variables: {}, }; const dailyQuestionResponse = await got({ @@ -57,25 +59,27 @@ async function handler() { const detailsPayload = { operationName: 'questionData', - query: /* GraphQL */ `query questionData($titleSlug: String!) { - question(titleSlug: $titleSlug) { - questionId - questionFrontendId - title - titleSlug - content - translatedTitle - translatedContent - difficulty - topicTags { - name - slug - translatedName + query: /* GraphQL */ ` + query questionData($titleSlug: String!) { + question(titleSlug: $titleSlug) { + questionId + questionFrontendId + title + titleSlug + content + translatedTitle + translatedContent + difficulty + topicTags { + name + slug + translatedName + __typename + } __typename } - __typename } - }`, + `, variables: { titleSlug: question.titleSlug, }, diff --git a/lib/routes/leetcode/dailyquestion-solution-cn.ts b/lib/routes/leetcode/dailyquestion-solution-cn.ts index c4538ad6fd..bfc8c3c929 100644 --- a/lib/routes/leetcode/dailyquestion-solution-cn.ts +++ b/lib/routes/leetcode/dailyquestion-solution-cn.ts @@ -41,20 +41,22 @@ async function handler() { url, json: { operationName: 'questionOfToday', - query: /* GraphQL */ `query questionOfToday { - todayRecord { - date - userStatus - question { - questionId - frontendQuestionId: questionFrontendId - difficulty - title - titleCn: translatedTitle - titleSlug - } + query: /* GraphQL */ ` + query questionOfToday { + todayRecord { + date + userStatus + question { + questionId + frontendQuestionId: questionFrontendId + difficulty + title + titleCn: translatedTitle + titleSlug } - }`, + } + } + `, variables: {}, }, headers, @@ -70,22 +72,24 @@ async function handler() { url, json: { operationName: 'questionData', - query: /* GraphQL */ `query questionData($titleSlug: String!) { - question(titleSlug: $titleSlug) { - questionId - questionFrontendId - categoryTitle - boundTopicId - title - titleSlug - content - translatedTitle - translatedContent - isPaidOnly - difficulty - likes - } - }`, + query: /* GraphQL */ ` + query questionData($titleSlug: String!) { + question(titleSlug: $titleSlug) { + questionId + questionFrontendId + categoryTitle + boundTopicId + title + titleSlug + content + translatedTitle + translatedContent + isPaidOnly + difficulty + likes + } + } + `, variables: { titleSlug: questionTitle, }, @@ -101,30 +105,32 @@ async function handler() { url, json: { operationName: 'questionSolutionArticles', - query: /* GraphQL */ `query questionSolutionArticles($questionSlug: String!, $skip: Int, $first: Int, $orderBy: SolutionArticleOrderBy, $userInput: String, $tagSlugs: [String!]) { - questionSolutionArticles(questionSlug: $questionSlug, skip: $skip, first: $first, orderBy: $orderBy, userInput: $userInput, tagSlugs: $tagSlugs) { - totalNum - edges { - node { + query: /* GraphQL */ ` + query questionSolutionArticles($questionSlug: String!, $skip: Int, $first: Int, $orderBy: SolutionArticleOrderBy, $userInput: String, $tagSlugs: [String!]) { + questionSolutionArticles(questionSlug: $questionSlug, skip: $skip, first: $first, orderBy: $orderBy, userInput: $userInput, tagSlugs: $tagSlugs) { + totalNum + edges { + node { ...solutionArticle __typename - } - __typename } __typename } + __typename } - fragment solutionArticle on SolutionArticleNode { - uuid - title - slug - createdAt - thumbnail - author { - username - } - summary - }`, + } + fragment solutionArticle on SolutionArticleNode { + uuid + title + slug + createdAt + thumbnail + author { + username + } + summary + } + `, variables: { questionSlug: questionTitle, first: 3, @@ -144,27 +150,29 @@ async function handler() { url, json: { operationName: 'solutionDetailArticle', - query: /* GraphQL */ `query solutionDetailArticle($slug: String!, $orderBy: SolutionArticleOrderBy!) { - solutionArticle(slug: $slug, orderBy: $orderBy) { - ...solutionArticle - content - question { - questionTitleSlug - __typename - } + query: /* GraphQL */ ` + query solutionDetailArticle($slug: String!, $orderBy: SolutionArticleOrderBy!) { + solutionArticle(slug: $slug, orderBy: $orderBy) { + ...solutionArticle + content + question { + questionTitleSlug + __typename } } - fragment solutionArticle on SolutionArticleNode { - uuid - title - slug - createdAt - thumbnail - author { - username - } - summary - }`, + } + fragment solutionArticle on SolutionArticleNode { + uuid + title + slug + createdAt + thumbnail + author { + username + } + summary + } + `, variables: { slug: art.node.slug, orderBy: 'DEFAULT', diff --git a/lib/routes/leetcode/dailyquestion-solution-en.ts b/lib/routes/leetcode/dailyquestion-solution-en.ts index f7c7b698a4..7542159f69 100644 --- a/lib/routes/leetcode/dailyquestion-solution-en.ts +++ b/lib/routes/leetcode/dailyquestion-solution-en.ts @@ -42,16 +42,18 @@ async function handler() { url, json: { operationName: 'questionOfToday', - query: /* GraphQL */ `query questionOfToday { - activeDailyCodingChallengeQuestion { - date - link - question { - frontendQuestionId: questionFrontendId - titleSlug - } + query: /* GraphQL */ ` + query questionOfToday { + activeDailyCodingChallengeQuestion { + date + link + question { + frontendQuestionId: questionFrontendId + titleSlug } - }`, + } + } + `, variables: {}, }, headers, @@ -67,22 +69,24 @@ async function handler() { url, json: { operationName: 'questionData', - query: /* GraphQL */ `query questionData($titleSlug: String!) { - question(titleSlug: $titleSlug) { - questionId - questionFrontendId - categoryTitle - boundTopicId - title - titleSlug - content - translatedTitle - translatedContent - isPaidOnly - difficulty - likes - } - }`, + query: /* GraphQL */ ` + query questionData($titleSlug: String!) { + question(titleSlug: $titleSlug) { + questionId + questionFrontendId + categoryTitle + boundTopicId + title + titleSlug + content + translatedTitle + translatedContent + isPaidOnly + difficulty + likes + } + } + `, variables: { titleSlug: questionTitle, }, @@ -98,29 +102,31 @@ async function handler() { url, json: { operationName: 'QuestionNote', - query: /* GraphQL */ `query QuestionNote($titleSlug: String!) { - question(titleSlug: $titleSlug) { - questionId - article - solution { - id - content - contentTypeId - canSeeDetail - paidOnly - hasVideoSolution - paidOnlyVideo - rating { - id - count - average - userRating { - score - } + query: /* GraphQL */ ` + query QuestionNote($titleSlug: String!) { + question(titleSlug: $titleSlug) { + questionId + article + solution { + id + content + contentTypeId + canSeeDetail + paidOnly + hasVideoSolution + paidOnlyVideo + rating { + id + count + average + userRating { + score + } + } + } } - } } - }`, + `, variables: { titleSlug: questionTitle, }, diff --git a/lib/routes/medium/graphql.ts b/lib/routes/medium/graphql.ts index 171d388879..39d11328e7 100644 --- a/lib/routes/medium/graphql.ts +++ b/lib/routes/medium/graphql.ts @@ -57,29 +57,31 @@ function newFollowingFeedQuery(pagingLimit = 5) { limit: pagingLimit, }, }, - query: /* GraphQL */ `query LegacyFollowingFeedQuery($paging: PagingOptions) { - followingFeed(paging: $paging) { - items { - feedId - post { - mediumUrl - __typename + query: /* GraphQL */ ` + query LegacyFollowingFeedQuery($paging: PagingOptions) { + followingFeed(paging: $paging) { + items { + feedId + post { + mediumUrl + __typename + } + __typename + } + pagingInfo { + next { + to + from + limit + source + __typename + } + __typename + } + __typename } - __typename - } - pagingInfo { - next { - to - from - limit - source - __typename - } - __typename - } - __typename } - }`, + `, }; } @@ -92,28 +94,30 @@ function newWebInlineRecommendedFeedQuery(pagingLimit = 5) { limit: pagingLimit, }, }, - query: /* GraphQL */ `query LegacyWebInlineRecommendedFeedQuery($paging: PagingOptions, $forceRank: Boolean) { - webRecommendedFeed(paging: $paging, forceRank: $forceRank) { - items { - feedId - post { - mediumUrl - __typename + query: /* GraphQL */ ` + query LegacyWebInlineRecommendedFeedQuery($paging: PagingOptions, $forceRank: Boolean) { + webRecommendedFeed(paging: $paging, forceRank: $forceRank) { + items { + feedId + post { + mediumUrl + __typename + } + __typename + } + pagingInfo { + next { + limit + to + source + __typename + } + __typename + } + __typename } - __typename - } - pagingInfo { - next { - limit - to - source - __typename - } - __typename - } - __typename } - }`, + `, }; } @@ -127,29 +131,31 @@ function newWebInlineTopicFeedQuery(tagSlug, pagingLimit = 5) { }, skipCache: true, }, - query: /* GraphQL */ `query LegacyWebInlineTopicFeedQuery($tagSlug: String!, $paging: PagingOptions!, $skipCache: Boolean) { - personalisedTagFeed(tagSlug: $tagSlug, paging: $paging, skipCache: $skipCache) { - items { - feedId - post { - mediumUrl - __typename + query: /* GraphQL */ ` + query LegacyWebInlineTopicFeedQuery($tagSlug: String!, $paging: PagingOptions!, $skipCache: Boolean) { + personalisedTagFeed(tagSlug: $tagSlug, paging: $paging, skipCache: $skipCache) { + items { + feedId + post { + mediumUrl + __typename + } + __typename + } + pagingInfo { + next { + source + limit + from + to + __typename + } + __typename + } + __typename } - __typename - } - pagingInfo { - next { - source - limit - from - to - __typename - } - __typename - } - __typename } - }`, + `, }; } @@ -162,24 +168,26 @@ function newUserCatalogMainContentQuery(catalogId, pagingLimit = 20) { limit: pagingLimit, }, }, - query: /* GraphQL */ `query UserCatalogMainContentQuery($catalogId: ID!, $pagingOptions: CatalogPagingOptionsInput!) { - catalogById(catalogId: $catalogId) { - __typename - ... on Catalog { - name - itemsConnection(pagingOptions: $pagingOptions) { - items { - entity { - ... on Post { - mediumUrl - } - } + query: /* GraphQL */ ` + query UserCatalogMainContentQuery($catalogId: ID!, $pagingOptions: CatalogPagingOptionsInput!) { + catalogById(catalogId: $catalogId) { __typename - } - __typename + ... on Catalog { + name + itemsConnection(pagingOptions: $pagingOptions) { + items { + entity { + ... on Post { + mediumUrl + } + } + __typename + } + __typename + } + } } - } } - }`, + `, }; } diff --git a/lib/routes/sustainabilitymag/articles.ts b/lib/routes/sustainabilitymag/articles.ts index fe7d3cb795..0b292f55ee 100644 --- a/lib/routes/sustainabilitymag/articles.ts +++ b/lib/routes/sustainabilitymag/articles.ts @@ -71,33 +71,35 @@ async function handler() { const requestEndpoint = `${baseURL}/graphql`; const requestBody = JSON.stringify({ - query: /* GraphQL */ `query PaginatedQuery($url: String!, $page: Int = 1, $widgetType: String!) { - paginatedWidget(url: $url, widgetType: $widgetType) { - ... on SimpleArticleGridWidget { - articles(page: $page) { - results { - _id - headline - fullUrlPath - featured - category - contentType - tags { - tag - } - attribution - subAttribution - sell - images { - thumbnail_widescreen_553 { - url + query: /* GraphQL */ ` + query PaginatedQuery($url: String!, $page: Int = 1, $widgetType: String!) { + paginatedWidget(url: $url, widgetType: $widgetType) { + ... on SimpleArticleGridWidget { + articles(page: $page) { + results { + _id + headline + fullUrlPath + featured + category + contentType + tags { + tag + } + attribution + subAttribution + sell + images { + thumbnail_widescreen_553 { + url + } + } + } + } } - } } - } } - } - }`, + `, operationName: 'PaginatedQuery', variables: { widgetType: 'simpleArticleGrid',