Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QZ-509 QZ-482 Specific queries to get first N latest and popular articles #85

Merged
merged 4 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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