Skip to content

Commit

Permalink
QZ-509 QZ-482 Specific queries to get first N latest and popular arti…
Browse files Browse the repository at this point in the history
…cles (#85)

* QZ-509 Add specific query to get first n latest articles
* QZ-482 Add specific query to get first n popular articles

Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
itjhai-qz and actions-user committed Jan 21, 2022
1 parent abd8a27 commit bfb721d
Show file tree
Hide file tree
Showing 31 changed files with 1,380 additions and 4 deletions.
23 changes: 23 additions & 0 deletions Queries/Articles/FirstFeedConcentByRecency.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
query FirstFeedConcentByRecency(
$first: Int
) {
feedContent( first: $first ) @connection(key: "FirstFeedConcentByRecency") {
nodes {
...on Post {
...ArticleTeaserParts
}
...on Email {
...EmailParts
link
emailLists {
nodes {
slug
}
}
}
}
pageInfo {
endCursor
}
}
}
21 changes: 21 additions & 0 deletions Queries/Articles/FirstPopularArticles.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
query FirstPopularArticles(
$edition: EditionName
$first: Int
) {
posts(
first: $first
where: {
popular: {
edition: $edition
}
}
) @connection(key: "FirstPopularArticles") {
nodes {
...ArticleTeaserParts
}
pageInfo {
endCursor
hasNextPage
}
}
}
8 changes: 8 additions & 0 deletions Schemas/ContentSchema.operations.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions Web/FirstFeedConcentByRecency.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions Web/FirstPopularArticles.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions Web/dist-cjs/FirstFeedConcentByRecency.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import type * as Types from './types';
import type { ArticleTeaserPartsFragment } from './ArticleTeaserParts';
import type { EmailPartsFragment } from './EmailParts';
import * as Apollo from '@apollo/client';
export declare type FirstFeedConcentByRecencyQueryVariables = Types.Exact<{
first?: Types.Maybe<Types.Scalars['Int']>;
}>;
export declare type FirstFeedConcentByRecencyQuery = {
__typename?: 'RootQuery';
feedContent?: Types.Maybe<{
__typename?: 'RootQueryToFeedContentConnection';
nodes?: Types.Maybe<Array<Types.Maybe<({
__typename?: 'Post';
} & ArticleTeaserPartsFragment) | {
__typename?: 'Page';
} | {
__typename?: 'MediaItem';
} | ({
__typename?: 'Email';
link?: Types.Maybe<string>;
emailLists?: Types.Maybe<{
__typename?: 'EmailToEmailListConnection';
nodes?: Types.Maybe<Array<Types.Maybe<{
__typename?: 'EmailList';
slug?: Types.Maybe<string>;
}>>>;
}>;
} & EmailPartsFragment) | {
__typename?: 'Chapter';
} | {
__typename?: 'Promotion';
} | {
__typename?: 'Collection';
} | {
__typename?: 'Bulletin';
}>>>;
pageInfo?: Types.Maybe<{
__typename?: 'WPPageInfo';
endCursor?: Types.Maybe<string>;
}>;
}>;
};
export declare const FirstFeedConcentByRecencyDocument: Apollo.DocumentNode;
/**
* __useFirstFeedConcentByRecencyQuery__
*
* To run a query within a React component, call `useFirstFeedConcentByRecencyQuery` and pass it any options that fit your needs.
* When your component renders, `useFirstFeedConcentByRecencyQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useFirstFeedConcentByRecencyQuery({
* variables: {
* first: // value for 'first'
* },
* });
*/
export declare function useFirstFeedConcentByRecencyQuery(baseOptions?: Apollo.QueryHookOptions<FirstFeedConcentByRecencyQuery, FirstFeedConcentByRecencyQueryVariables>): Apollo.QueryResult<FirstFeedConcentByRecencyQuery, Types.Exact<{
first?: Types.Maybe<number> | undefined;
}>>;
export declare function useFirstFeedConcentByRecencyLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FirstFeedConcentByRecencyQuery, FirstFeedConcentByRecencyQueryVariables>): Apollo.QueryTuple<FirstFeedConcentByRecencyQuery, Types.Exact<{
first?: Types.Maybe<number> | undefined;
}>>;
export declare type FirstFeedConcentByRecencyQueryHookResult = ReturnType<typeof useFirstFeedConcentByRecencyQuery>;
export declare type FirstFeedConcentByRecencyLazyQueryHookResult = ReturnType<typeof useFirstFeedConcentByRecencyLazyQuery>;
export declare type FirstFeedConcentByRecencyQueryResult = Apollo.QueryResult<FirstFeedConcentByRecencyQuery, FirstFeedConcentByRecencyQueryVariables>;
//# sourceMappingURL=FirstFeedConcentByRecency.d.ts.map
Loading

0 comments on commit bfb721d

Please sign in to comment.