Skip to content

Commit

Permalink
Add EmailsByTag query (#41)
Browse files Browse the repository at this point in the history
* Add EmailsByTag query

* Add Swift types

* Add TypeScript types

Co-authored-by: Brendan Hamill <bhamill@qz.com>
Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
3 people authored Feb 9, 2021
1 parent 624f08a commit 3776a1c
Show file tree
Hide file tree
Showing 22 changed files with 613 additions and 26 deletions.
19 changes: 19 additions & 0 deletions Queries/Emails/EmailsByTag.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
query EmailsByTag(
$tags: [String]
) {
emails(
where:{
tagSlugIn: $tags
}
) {
nodes {
...EmailParts
html
emailLists {
nodes {
...EmailListParts
}
}
}
}
}
32 changes: 16 additions & 16 deletions Schemas/ContentSchema.json

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

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.

64 changes: 64 additions & 0 deletions Web/EmailsByTag.ts

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

50 changes: 50 additions & 0 deletions Web/dist-cjs/EmailsByTag.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import type * as Types from './types';
import type { EmailPartsFragment } from './EmailParts';
import type { EmailListPartsFragment } from './EmailListParts';
import * as Apollo from '@apollo/client';
export declare type EmailsByTagQueryVariables = Types.Exact<{
tags?: Types.Maybe<Array<Types.Maybe<Types.Scalars['String']>>>;
}>;
export declare type EmailsByTagQuery = {
__typename?: 'RootQuery';
emails?: Types.Maybe<{
__typename?: 'RootQueryToEmailConnection';
nodes?: Types.Maybe<Array<Types.Maybe<({
__typename?: 'Email';
html?: Types.Maybe<string>;
emailLists?: Types.Maybe<{
__typename?: 'EmailToEmailListConnection';
nodes?: Types.Maybe<Array<Types.Maybe<({
__typename?: 'EmailList';
} & EmailListPartsFragment)>>>;
}>;
} & EmailPartsFragment)>>>;
}>;
};
export declare const EmailsByTagDocument: Apollo.DocumentNode;
/**
* __useEmailsByTagQuery__
*
* To run a query within a React component, call `useEmailsByTagQuery` and pass it any options that fit your needs.
* When your component renders, `useEmailsByTagQuery` 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 } = useEmailsByTagQuery({
* variables: {
* tags: // value for 'tags'
* },
* });
*/
export declare function useEmailsByTagQuery(baseOptions?: Apollo.QueryHookOptions<EmailsByTagQuery, EmailsByTagQueryVariables>): Apollo.QueryResult<EmailsByTagQuery, Types.Exact<{
tags?: (string | null)[] | null | undefined;
}>>;
export declare function useEmailsByTagLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<EmailsByTagQuery, EmailsByTagQueryVariables>): Apollo.QueryTuple<EmailsByTagQuery, Types.Exact<{
tags?: (string | null)[] | null | undefined;
}>>;
export declare type EmailsByTagQueryHookResult = ReturnType<typeof useEmailsByTagQuery>;
export declare type EmailsByTagLazyQueryHookResult = ReturnType<typeof useEmailsByTagLazyQuery>;
export declare type EmailsByTagQueryResult = Apollo.QueryResult<EmailsByTagQuery, EmailsByTagQueryVariables>;
//# sourceMappingURL=EmailsByTag.d.ts.map
1 change: 1 addition & 0 deletions Web/dist-cjs/EmailsByTag.d.ts.map

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

67 changes: 67 additions & 0 deletions Web/dist-cjs/EmailsByTag.js

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

1 change: 1 addition & 0 deletions Web/dist-cjs/EmailsByTag.js.map

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

1 change: 1 addition & 0 deletions Web/dist-cjs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export * from './EmailListParts';
export * from './EmailListsBySlug';
export * from './EmailParts';
export * from './EmailsByList';
export * from './EmailsByTag';
export * from './EssentialsByArticle';
export * from './EssentialsByGuide';
export * from './EssentialsByObsession';
Expand Down
Loading

0 comments on commit 3776a1c

Please sign in to comment.