diff --git a/app/page.tsx b/app/page.tsx index eaa0b47..7bf96e6 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -7,10 +7,12 @@ async function getData() { allArticles: ListArticles @skip(if: $bar) { totalCount } - allRepliedArticles: ListArticles { + allRepliedArticles: ListArticles(filter: { replyCount: { GTE: 1 } }) { totalCount } - articlesHasUsefulReplies: ListArticles { + articlesHasUsefulReplies: ListArticles( + filter: { hasArticleReplyWithMorePositiveFeedback: true } + ) { totalCount } } diff --git a/typegen/gql.ts b/typegen/gql.ts index a32bb7b..8c9b403 100644 --- a/typegen/gql.ts +++ b/typegen/gql.ts @@ -13,7 +13,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Therefore it is highly recommended to use the babel or swc plugin for production. */ const documents = { - "\n query LoadAPIStats($bar: Boolean!) {\n allArticles: ListArticles @skip(if: $bar) {\n totalCount\n }\n allRepliedArticles: ListArticles {\n totalCount\n }\n articlesHasUsefulReplies: ListArticles {\n totalCount\n }\n }\n ": types.LoadApiStatsDocument, + "\n query LoadAPIStats($bar: Boolean!) {\n allArticles: ListArticles @skip(if: $bar) {\n totalCount\n }\n allRepliedArticles: ListArticles(filter: { replyCount: { GTE: 1 } }) {\n totalCount\n }\n articlesHasUsefulReplies: ListArticles(\n filter: { hasArticleReplyWithMorePositiveFeedback: true }\n ) {\n totalCount\n }\n }\n ": types.LoadApiStatsDocument, }; /** @@ -33,7 +33,7 @@ export function graphql(source: string): unknown; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query LoadAPIStats($bar: Boolean!) {\n allArticles: ListArticles @skip(if: $bar) {\n totalCount\n }\n allRepliedArticles: ListArticles {\n totalCount\n }\n articlesHasUsefulReplies: ListArticles {\n totalCount\n }\n }\n "): (typeof documents)["\n query LoadAPIStats($bar: Boolean!) {\n allArticles: ListArticles @skip(if: $bar) {\n totalCount\n }\n allRepliedArticles: ListArticles {\n totalCount\n }\n articlesHasUsefulReplies: ListArticles {\n totalCount\n }\n }\n "]; +export function graphql(source: "\n query LoadAPIStats($bar: Boolean!) {\n allArticles: ListArticles @skip(if: $bar) {\n totalCount\n }\n allRepliedArticles: ListArticles(filter: { replyCount: { GTE: 1 } }) {\n totalCount\n }\n articlesHasUsefulReplies: ListArticles(\n filter: { hasArticleReplyWithMorePositiveFeedback: true }\n ) {\n totalCount\n }\n }\n "): (typeof documents)["\n query LoadAPIStats($bar: Boolean!) {\n allArticles: ListArticles @skip(if: $bar) {\n totalCount\n }\n allRepliedArticles: ListArticles(filter: { replyCount: { GTE: 1 } }) {\n totalCount\n }\n articlesHasUsefulReplies: ListArticles(\n filter: { hasArticleReplyWithMorePositiveFeedback: true }\n ) {\n totalCount\n }\n }\n "]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/typegen/graphql.ts b/typegen/graphql.ts index 260aad7..4c19877 100644 --- a/typegen/graphql.ts +++ b/typegen/graphql.ts @@ -1398,4 +1398,4 @@ export type LoadApiStatsQueryVariables = Exact<{ export type LoadApiStatsQuery = { allArticles: { totalCount: number } | null, allRepliedArticles: { totalCount: number } | null, articlesHasUsefulReplies: { totalCount: number } | null }; -export const LoadApiStatsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"LoadAPIStats"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"bar"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"allArticles"},"name":{"kind":"Name","value":"ListArticles"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"skip"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"if"},"value":{"kind":"Variable","name":{"kind":"Name","value":"bar"}}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"allRepliedArticles"},"name":{"kind":"Name","value":"ListArticles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"articlesHasUsefulReplies"},"name":{"kind":"Name","value":"ListArticles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const LoadApiStatsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"LoadAPIStats"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"bar"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"allArticles"},"name":{"kind":"Name","value":"ListArticles"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"skip"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"if"},"value":{"kind":"Variable","name":{"kind":"Name","value":"bar"}}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"allRepliedArticles"},"name":{"kind":"Name","value":"ListArticles"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"replyCount"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"GTE"},"value":{"kind":"IntValue","value":"1"}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"articlesHasUsefulReplies"},"name":{"kind":"Name","value":"ListArticles"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"hasArticleReplyWithMorePositiveFeedback"},"value":{"kind":"BooleanValue","value":true}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file