Skip to content

Commit

Permalink
Create ArticlesByAuthor.gql (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
hallee authored Jan 14, 2021
1 parent f266118 commit 4b92b13
Show file tree
Hide file tree
Showing 21 changed files with 701 additions and 4 deletions.
27 changes: 27 additions & 0 deletions Queries/Articles/ArticlesByAuthor.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
query ArticlesByAuthor(
$after: String = ""
$perPage: Int!
$slug: [String]
) {
authors:coAuthors(
where: {
name: $slug
}
) {
nodes {
...AuthorParts
posts(
after: $after
first: $perPage
) {
nodes {
...ArticleTeaserParts
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
}
4 changes: 4 additions & 0 deletions Schemas/ContentSchema.operations.json

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

71 changes: 71 additions & 0 deletions Web/ArticlesByAuthor.ts

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

62 changes: 62 additions & 0 deletions Web/dist-cjs/ArticlesByAuthor.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import type * as Types from './types';
import type { AuthorPartsFragment } from './AuthorParts';
import type { ArticleTeaserPartsFragment } from './ArticleTeaserParts';
import * as Apollo from '@apollo/client';
export declare type ArticlesByAuthorQueryVariables = Types.Exact<{
after?: Types.Maybe<Types.Scalars['String']>;
perPage: Types.Scalars['Int'];
slug?: Types.Maybe<Array<Types.Maybe<Types.Scalars['String']>>>;
}>;
export declare type ArticlesByAuthorQuery = {
__typename?: 'RootQuery';
authors?: Types.Maybe<{
__typename?: 'RootQueryToCoAuthorConnection';
nodes?: Types.Maybe<Array<Types.Maybe<({
__typename?: 'CoAuthor';
posts?: Types.Maybe<{
__typename?: 'CoAuthorToPostConnection';
nodes?: Types.Maybe<Array<Types.Maybe<({
__typename?: 'Post';
} & ArticleTeaserPartsFragment)>>>;
pageInfo?: Types.Maybe<{
__typename?: 'WPPageInfo';
endCursor?: Types.Maybe<string>;
hasNextPage: boolean;
}>;
}>;
} & AuthorPartsFragment)>>>;
}>;
};
export declare const ArticlesByAuthorDocument: Apollo.DocumentNode;
/**
* __useArticlesByAuthorQuery__
*
* To run a query within a React component, call `useArticlesByAuthorQuery` and pass it any options that fit your needs.
* When your component renders, `useArticlesByAuthorQuery` 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 } = useArticlesByAuthorQuery({
* variables: {
* after: // value for 'after'
* perPage: // value for 'perPage'
* slug: // value for 'slug'
* },
* });
*/
export declare function useArticlesByAuthorQuery(baseOptions: Apollo.QueryHookOptions<ArticlesByAuthorQuery, ArticlesByAuthorQueryVariables>): Apollo.QueryResult<ArticlesByAuthorQuery, Types.Exact<{
after?: string | null | undefined;
perPage: number;
slug?: (string | null)[] | null | undefined;
}>>;
export declare function useArticlesByAuthorLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ArticlesByAuthorQuery, ArticlesByAuthorQueryVariables>): Apollo.QueryTuple<ArticlesByAuthorQuery, Types.Exact<{
after?: string | null | undefined;
perPage: number;
slug?: (string | null)[] | null | undefined;
}>>;
export declare type ArticlesByAuthorQueryHookResult = ReturnType<typeof useArticlesByAuthorQuery>;
export declare type ArticlesByAuthorLazyQueryHookResult = ReturnType<typeof useArticlesByAuthorLazyQuery>;
export declare type ArticlesByAuthorQueryResult = Apollo.QueryResult<ArticlesByAuthorQuery, ArticlesByAuthorQueryVariables>;
//# sourceMappingURL=ArticlesByAuthor.d.ts.map
1 change: 1 addition & 0 deletions Web/dist-cjs/ArticlesByAuthor.d.ts.map

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

Loading

0 comments on commit 4b92b13

Please sign in to comment.