refactor: add GraphQL annotation to queries for auto formatting in oxfmt v0.42
0fe46fe333
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export const pageByNavigationPathQuery = `query pageByNavigationPath(
|
||||
export const pageByNavigationPathQuery = /* GraphQL */ `query pageByNavigationPath(
|
||||
$input: PageByNavigationPathInput!
|
||||
$firstStories: Int
|
||||
$afterStories: Cursor
|
||||
@@ -216,7 +216,7 @@ export const pageByNavigationPathQuery = `query pageByNavigationPath(
|
||||
}
|
||||
}`;
|
||||
|
||||
export const assetsConnectionByCriteriaQuery = `query assetsConnectionByCriteria(
|
||||
export const assetsConnectionByCriteriaQuery = /* GraphQL */ `query assetsConnectionByCriteria(
|
||||
$after: ID
|
||||
$brand: Brand!
|
||||
$categories: [Int!]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const getProfileProjectsAndSelectionsQuery = `query GetProfileProjectsAndSections($username: String, $after: String) {
|
||||
export const getProfileProjectsAndSelectionsQuery = /* GraphQL */ `query GetProfileProjectsAndSections($username: String, $after: String) {
|
||||
user(username: $username) {
|
||||
hasPortfolio
|
||||
profileSections {
|
||||
@@ -172,7 +172,7 @@ export const getProfileProjectsAndSelectionsQuery = `query GetProfileProjectsAnd
|
||||
userId
|
||||
}`;
|
||||
|
||||
export const getAppreciatedQuery = `query GetAppreciatedProjects($username: String, $after: String) {
|
||||
export const getAppreciatedQuery = /* GraphQL */ `query GetAppreciatedProjects($username: String, $after: String) {
|
||||
user(username: $username) {
|
||||
appreciatedProjects(first: 24, after: $after) {
|
||||
nodes {
|
||||
@@ -247,7 +247,7 @@ export const getAppreciatedQuery = `query GetAppreciatedProjects($username: Stri
|
||||
}
|
||||
}`;
|
||||
|
||||
export const getProjectPageQuery = `query ProjectPage($projectId: ProjectId!, $projectPassword: String) {
|
||||
export const getProjectPageQuery = /* GraphQL */ `query ProjectPage($projectId: ProjectId!, $projectPassword: String) {
|
||||
viewer {
|
||||
...Project_Viewer
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export const getCreatorPostReelList = (identifier: string, limit: number): Promi
|
||||
Referer: baseUrl,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: `query CreatorPostReelList($identifier: String!, $first: Int, $after: String, $last: Int, $before: String) {
|
||||
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}]
|
||||
|
||||
@@ -36,7 +36,7 @@ async function handler(ctx) {
|
||||
json: {
|
||||
operationName: 'comicById',
|
||||
variables: { comicId: id },
|
||||
query: `query comicById($comicId: ID!) {
|
||||
query: /* GraphQL */ `query comicById($comicId: ID!) {
|
||||
comicById(comicId: $comicId) {
|
||||
title
|
||||
imageUrl
|
||||
@@ -51,7 +51,7 @@ async function handler(ctx) {
|
||||
json: {
|
||||
operationName: 'chapterByComicId',
|
||||
variables: { comicId: id },
|
||||
query: `query chapterByComicId($comicId: ID!) {
|
||||
query: /* GraphQL */ `query chapterByComicId($comicId: ID!) {
|
||||
chaptersByComicId(comicId: $comicId) {
|
||||
id
|
||||
serial
|
||||
|
||||
@@ -66,7 +66,7 @@ async function handler() {
|
||||
body: {
|
||||
operationName: 'questionContent',
|
||||
variables: { titleSlug },
|
||||
query: `query questionContent($titleSlug: String!) {
|
||||
query: /* GraphQL */ `query questionContent($titleSlug: String!) {
|
||||
question(titleSlug: $titleSlug) {
|
||||
content
|
||||
mysqlSchemas
|
||||
@@ -81,7 +81,7 @@ async function handler() {
|
||||
body: {
|
||||
operationName: 'officialSolution',
|
||||
variables: { titleSlug },
|
||||
query: `query officialSolution($titleSlug: String!) {
|
||||
query: /* GraphQL */ `query officialSolution($titleSlug: String!) {
|
||||
question(titleSlug: $titleSlug) {
|
||||
solution {
|
||||
content
|
||||
|
||||
@@ -30,7 +30,7 @@ async function handler() {
|
||||
};
|
||||
const url = host + '/graphql';
|
||||
const dailyQuestionPayload = {
|
||||
query: `query questionOfToday {
|
||||
query: /* GraphQL */ `query questionOfToday {
|
||||
todayRecord {
|
||||
date
|
||||
question {
|
||||
@@ -56,7 +56,7 @@ async function handler() {
|
||||
|
||||
const detailsPayload = {
|
||||
operationName: 'questionData',
|
||||
query: `query questionData($titleSlug: String!) {
|
||||
query: /* GraphQL */ `query questionData($titleSlug: String!) {
|
||||
question(titleSlug: $titleSlug) {
|
||||
questionId
|
||||
questionFrontendId
|
||||
|
||||
@@ -30,7 +30,7 @@ async function handler() {
|
||||
};
|
||||
const url = host + '/graphql';
|
||||
const dailyQuestionPayload = {
|
||||
query: `query questionOfToday {
|
||||
query: /* GraphQL */ `query questionOfToday {
|
||||
activeDailyCodingChallengeQuestion {
|
||||
date
|
||||
link
|
||||
@@ -57,7 +57,7 @@ async function handler() {
|
||||
|
||||
const detailsPayload = {
|
||||
operationName: 'questionData',
|
||||
query: `query questionData($titleSlug: String!) {
|
||||
query: /* GraphQL */ `query questionData($titleSlug: String!) {
|
||||
question(titleSlug: $titleSlug) {
|
||||
questionId
|
||||
questionFrontendId
|
||||
|
||||
@@ -41,7 +41,7 @@ async function handler() {
|
||||
url,
|
||||
json: {
|
||||
operationName: 'questionOfToday',
|
||||
query: `query questionOfToday {
|
||||
query: /* GraphQL */ `query questionOfToday {
|
||||
todayRecord {
|
||||
date
|
||||
userStatus
|
||||
@@ -70,7 +70,7 @@ async function handler() {
|
||||
url,
|
||||
json: {
|
||||
operationName: 'questionData',
|
||||
query: `query questionData($titleSlug: String!) {
|
||||
query: /* GraphQL */ `query questionData($titleSlug: String!) {
|
||||
question(titleSlug: $titleSlug) {
|
||||
questionId
|
||||
questionFrontendId
|
||||
@@ -101,7 +101,7 @@ async function handler() {
|
||||
url,
|
||||
json: {
|
||||
operationName: 'questionSolutionArticles',
|
||||
query: `query questionSolutionArticles($questionSlug: String!, $skip: Int, $first: Int, $orderBy: SolutionArticleOrderBy, $userInput: String, $tagSlugs: [String!]) {
|
||||
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 {
|
||||
@@ -144,7 +144,7 @@ async function handler() {
|
||||
url,
|
||||
json: {
|
||||
operationName: 'solutionDetailArticle',
|
||||
query: `query solutionDetailArticle($slug: String!, $orderBy: SolutionArticleOrderBy!) {
|
||||
query: /* GraphQL */ `query solutionDetailArticle($slug: String!, $orderBy: SolutionArticleOrderBy!) {
|
||||
solutionArticle(slug: $slug, orderBy: $orderBy) {
|
||||
...solutionArticle
|
||||
content
|
||||
|
||||
@@ -42,7 +42,7 @@ async function handler() {
|
||||
url,
|
||||
json: {
|
||||
operationName: 'questionOfToday',
|
||||
query: `query questionOfToday {
|
||||
query: /* GraphQL */ `query questionOfToday {
|
||||
activeDailyCodingChallengeQuestion {
|
||||
date
|
||||
link
|
||||
@@ -67,7 +67,7 @@ async function handler() {
|
||||
url,
|
||||
json: {
|
||||
operationName: 'questionData',
|
||||
query: `query questionData($titleSlug: String!) {
|
||||
query: /* GraphQL */ `query questionData($titleSlug: String!) {
|
||||
question(titleSlug: $titleSlug) {
|
||||
questionId
|
||||
questionFrontendId
|
||||
@@ -98,7 +98,7 @@ async function handler() {
|
||||
url,
|
||||
json: {
|
||||
operationName: 'QuestionNote',
|
||||
query: `query QuestionNote($titleSlug: String!) {
|
||||
query: /* GraphQL */ `query QuestionNote($titleSlug: String!) {
|
||||
question(titleSlug: $titleSlug) {
|
||||
questionId
|
||||
article
|
||||
@@ -172,7 +172,7 @@ async function handler() {
|
||||
url,
|
||||
json: {
|
||||
operationName: 'fetchPlayground',
|
||||
query: `query fetchPlayground {
|
||||
query: /* GraphQL */ `query fetchPlayground {
|
||||
playground(uuid: "${uuid}") {
|
||||
testcaseInput
|
||||
name
|
||||
|
||||
@@ -9,7 +9,7 @@ const handler = async (ctx) => {
|
||||
const response = await ofetch(gqlEndpoint, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
query: `{
|
||||
query: /* GraphQL */ `{
|
||||
user(input: {userName: "${uid}"}) {
|
||||
displayName
|
||||
avatar
|
||||
|
||||
@@ -24,7 +24,7 @@ const handler = async (ctx) => {
|
||||
const response = await ofetch(gqlEndpoint, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
query: `{
|
||||
query: /* GraphQL */ `{
|
||||
viewer {
|
||||
recommendation {
|
||||
feed: ${options[type].apiType}(input: {first: ${limit}}) {
|
||||
|
||||
@@ -35,7 +35,7 @@ const handler = async (ctx) => {
|
||||
const gqlResponse = await ofetch(gqlEndpoint, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
query: `{
|
||||
query: /* GraphQL */ `{
|
||||
node(input: {id: "${tagId}"}) {
|
||||
... on Tag {
|
||||
content
|
||||
|
||||
@@ -57,7 +57,7 @@ function newFollowingFeedQuery(pagingLimit = 5) {
|
||||
limit: pagingLimit,
|
||||
},
|
||||
},
|
||||
query: `query LegacyFollowingFeedQuery($paging: PagingOptions) {
|
||||
query: /* GraphQL */ `query LegacyFollowingFeedQuery($paging: PagingOptions) {
|
||||
followingFeed(paging: $paging) {
|
||||
items {
|
||||
feedId
|
||||
@@ -92,7 +92,7 @@ function newWebInlineRecommendedFeedQuery(pagingLimit = 5) {
|
||||
limit: pagingLimit,
|
||||
},
|
||||
},
|
||||
query: `query LegacyWebInlineRecommendedFeedQuery($paging: PagingOptions, $forceRank: Boolean) {
|
||||
query: /* GraphQL */ `query LegacyWebInlineRecommendedFeedQuery($paging: PagingOptions, $forceRank: Boolean) {
|
||||
webRecommendedFeed(paging: $paging, forceRank: $forceRank) {
|
||||
items {
|
||||
feedId
|
||||
@@ -127,7 +127,7 @@ function newWebInlineTopicFeedQuery(tagSlug, pagingLimit = 5) {
|
||||
},
|
||||
skipCache: true,
|
||||
},
|
||||
query: `query LegacyWebInlineTopicFeedQuery($tagSlug: String!, $paging: PagingOptions!, $skipCache: Boolean) {
|
||||
query: /* GraphQL */ `query LegacyWebInlineTopicFeedQuery($tagSlug: String!, $paging: PagingOptions!, $skipCache: Boolean) {
|
||||
personalisedTagFeed(tagSlug: $tagSlug, paging: $paging, skipCache: $skipCache) {
|
||||
items {
|
||||
feedId
|
||||
@@ -162,7 +162,7 @@ function newUserCatalogMainContentQuery(catalogId, pagingLimit = 20) {
|
||||
limit: pagingLimit,
|
||||
},
|
||||
},
|
||||
query: `query UserCatalogMainContentQuery($catalogId: ID!, $pagingOptions: CatalogPagingOptionsInput!) {
|
||||
query: /* GraphQL */ `query UserCatalogMainContentQuery($catalogId: ID!, $pagingOptions: CatalogPagingOptionsInput!) {
|
||||
catalogById(catalogId: $catalogId) {
|
||||
__typename
|
||||
... on Catalog {
|
||||
|
||||
@@ -44,7 +44,7 @@ async function callApi(objectType: string, objectFields: string, username: strin
|
||||
const headers = MIXCLOUD_CONFIG.headers;
|
||||
|
||||
const lookupParams = slug ? `, slug: "${slug}"` : '';
|
||||
const query = `{
|
||||
const query = /* GraphQL */ `{
|
||||
${lookupKey}(lookup: {username: "${username}"${lookupParams}}) {
|
||||
${objectFields}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ async function handler() {
|
||||
|
||||
const requestEndpoint = `${baseURL}/graphql`;
|
||||
const requestBody = JSON.stringify({
|
||||
query: `query PaginatedQuery($url: String!, $page: Int = 1, $widgetType: String!) {
|
||||
query: /* GraphQL */ `query PaginatedQuery($url: String!, $page: Int = 1, $widgetType: String!) {
|
||||
paginatedWidget(url: $url, widgetType: $widgetType) {
|
||||
... on SimpleArticleGridWidget {
|
||||
articles(page: $page) {
|
||||
|
||||
Reference in New Issue
Block a user