Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix stencil-apollo plugin for stencil-one * Fix tests * Update docs * Do not use functional components * Support stencil's bundler * Use general config for fragments
- Loading branch information
1 parent
b5f7fb3
commit 4c60eb9
Showing
24 changed files
with
452 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
dev-test/githunt/comment-added.subscription.stencil-component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// tslint:disable | ||
import * as Types from './types.d'; | ||
|
||
import gql from 'graphql-tag'; | ||
import 'stencil-apollo'; | ||
import { Component, Prop, h } from '@stencil/core'; | ||
|
||
declare global { | ||
export type OnCommentAddedSubscriptionVariables = { | ||
repoFullName: Types.Scalars['String'] | ||
}; | ||
|
||
|
||
export type OnCommentAddedSubscription = ({ __typename?: 'Subscription' } & { commentAdded: Types.Maybe<({ __typename?: 'Comment' } & Pick<Types.Comment, 'id' | 'createdAt' | 'content'> & { postedBy: ({ __typename?: 'User' } & Pick<Types.User, 'login' | 'html_url'>) })> }); | ||
|
||
} | ||
|
||
|
||
const OnCommentAddedDocument = gql` | ||
subscription onCommentAdded($repoFullName: String!) { | ||
commentAdded(repoFullName: $repoFullName) { | ||
id | ||
postedBy { | ||
login | ||
html_url | ||
} | ||
createdAt | ||
content | ||
} | ||
} | ||
`; | ||
|
||
@Component({ | ||
tag: 'apollo-on-comment-added' | ||
}) | ||
export class OnCommentAddedComponent { | ||
@Prop() renderer: import('stencil-apollo').SubscriptionRenderer<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>; | ||
render() { | ||
return <apollo-subscription subscription={ OnCommentAddedDocument } renderer={ this.renderer } />; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// tslint:disable | ||
import * as Types from './types.d'; | ||
|
||
import gql from 'graphql-tag'; | ||
import { CommentsPageCommentFragmentDoc } from './comments-page-comment.fragment.stencil-component'; | ||
import 'stencil-apollo'; | ||
import { Component, Prop, h } from '@stencil/core'; | ||
|
||
declare global { | ||
export type CommentQueryVariables = { | ||
repoFullName: Types.Scalars['String'], | ||
limit?: Types.Maybe<Types.Scalars['Int']>, | ||
offset?: Types.Maybe<Types.Scalars['Int']> | ||
}; | ||
|
||
|
||
export type CommentQuery = ({ __typename?: 'Query' } & { currentUser: Types.Maybe<({ __typename?: 'User' } & Pick<Types.User, 'login' | 'html_url'>)>, entry: Types.Maybe<({ __typename?: 'Entry' } & Pick<Types.Entry, 'id' | 'createdAt' | 'commentCount'> & { postedBy: ({ __typename?: 'User' } & Pick<Types.User, 'login' | 'html_url'>), comments: Array<Types.Maybe<({ __typename?: 'Comment' } & CommentsPageCommentFragment)>>, repository: ({ __typename?: 'Repository' } & Pick<Types.Repository, 'full_name' | 'html_url'> & ({ __typename?: 'Repository' } & Pick<Types.Repository, 'description' | 'open_issues_count' | 'stargazers_count'>)) })> }); | ||
|
||
} | ||
|
||
|
||
const CommentDocument = gql` | ||
query Comment($repoFullName: String!, $limit: Int, $offset: Int) { | ||
currentUser { | ||
login | ||
html_url | ||
} | ||
entry(repoFullName: $repoFullName) { | ||
id | ||
postedBy { | ||
login | ||
html_url | ||
} | ||
createdAt | ||
comments(limit: $limit, offset: $offset) { | ||
...CommentsPageComment | ||
} | ||
commentCount | ||
repository { | ||
full_name | ||
html_url | ||
... on Repository { | ||
description | ||
open_issues_count | ||
stargazers_count | ||
} | ||
} | ||
} | ||
} | ||
${CommentsPageCommentFragmentDoc}`; | ||
|
||
@Component({ | ||
tag: 'apollo-comment' | ||
}) | ||
export class CommentComponent { | ||
@Prop() renderer: import('stencil-apollo').QueryRenderer<CommentQuery, CommentQueryVariables>; | ||
render() { | ||
return <apollo-query query={ CommentDocument } renderer={ this.renderer } />; | ||
} | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
dev-test/githunt/comments-page-comment.fragment.stencil-component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// tslint:disable | ||
import * as Types from './types.d'; | ||
|
||
import gql from 'graphql-tag'; | ||
|
||
declare global { | ||
export type CommentsPageCommentFragment = ({ __typename?: 'Comment' } & Pick<Types.Comment, 'id' | 'createdAt' | 'content'> & { postedBy: ({ __typename?: 'User' } & Pick<Types.User, 'login' | 'html_url'>) }); | ||
|
||
} | ||
|
||
export const CommentsPageCommentFragmentDoc = gql` | ||
fragment CommentsPageComment on Comment { | ||
id | ||
postedBy { | ||
login | ||
html_url | ||
} | ||
createdAt | ||
content | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// tslint:disable | ||
import * as Types from './types.d'; | ||
|
||
import gql from 'graphql-tag'; | ||
import 'stencil-apollo'; | ||
import { Component, Prop, h } from '@stencil/core'; | ||
|
||
declare global { | ||
export type CurrentUserForProfileQueryVariables = {}; | ||
|
||
|
||
export type CurrentUserForProfileQuery = ({ __typename?: 'Query' } & { currentUser: Types.Maybe<({ __typename?: 'User' } & Pick<Types.User, 'login' | 'avatar_url'>)> }); | ||
|
||
} | ||
|
||
|
||
const CurrentUserForProfileDocument = gql` | ||
query CurrentUserForProfile { | ||
currentUser { | ||
login | ||
avatar_url | ||
} | ||
} | ||
`; | ||
|
||
@Component({ | ||
tag: 'apollo-current-user-for-profile' | ||
}) | ||
export class CurrentUserForProfileComponent { | ||
@Prop() renderer: import('stencil-apollo').QueryRenderer<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>; | ||
render() { | ||
return <apollo-query query={ CurrentUserForProfileDocument } renderer={ this.renderer } />; | ||
} | ||
} | ||
|
28 changes: 28 additions & 0 deletions
28
dev-test/githunt/feed-entry.fragment.stencil-component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// tslint:disable | ||
import * as Types from './types.d'; | ||
|
||
import gql from 'graphql-tag'; | ||
import { VoteButtonsFragmentDoc } from './vote-buttons.fragment.stencil-component'; | ||
import { RepoInfoFragmentDoc } from './repo-info.fragment.stencil-component'; | ||
|
||
declare global { | ||
export type FeedEntryFragment = ({ __typename?: 'Entry' } & Pick<Types.Entry, 'id' | 'commentCount'> & { repository: ({ __typename?: 'Repository' } & Pick<Types.Repository, 'full_name' | 'html_url'> & { owner: Types.Maybe<({ __typename?: 'User' } & Pick<Types.User, 'avatar_url'>)> }) } & (VoteButtonsFragment & RepoInfoFragment)); | ||
|
||
} | ||
|
||
export const FeedEntryFragmentDoc = gql` | ||
fragment FeedEntry on Entry { | ||
id | ||
commentCount | ||
repository { | ||
full_name | ||
html_url | ||
owner { | ||
avatar_url | ||
} | ||
} | ||
...VoteButtons | ||
...RepoInfo | ||
} | ||
${VoteButtonsFragmentDoc} | ||
${RepoInfoFragmentDoc}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// tslint:disable | ||
import * as Types from './types.d'; | ||
|
||
import gql from 'graphql-tag'; | ||
import { FeedEntryFragmentDoc } from './feed-entry.fragment.stencil-component'; | ||
import { VoteButtonsFragmentDoc } from './vote-buttons.fragment.stencil-component'; | ||
import { RepoInfoFragmentDoc } from './repo-info.fragment.stencil-component'; | ||
import 'stencil-apollo'; | ||
import { Component, Prop, h } from '@stencil/core'; | ||
|
||
declare global { | ||
export type FeedQueryVariables = { | ||
type: Types.FeedType, | ||
offset?: Types.Maybe<Types.Scalars['Int']>, | ||
limit?: Types.Maybe<Types.Scalars['Int']> | ||
}; | ||
|
||
|
||
export type FeedQuery = ({ __typename?: 'Query' } & { currentUser: Types.Maybe<({ __typename?: 'User' } & Pick<Types.User, 'login'>)>, feed: Types.Maybe<Array<Types.Maybe<({ __typename?: 'Entry' } & FeedEntryFragment)>>> }); | ||
|
||
} | ||
|
||
|
||
const FeedDocument = gql` | ||
query Feed($type: FeedType!, $offset: Int, $limit: Int) { | ||
currentUser { | ||
login | ||
} | ||
feed(type: $type, offset: $offset, limit: $limit) { | ||
...FeedEntry | ||
} | ||
} | ||
${FeedEntryFragmentDoc}`; | ||
|
||
@Component({ | ||
tag: 'apollo-feed' | ||
}) | ||
export class FeedComponent { | ||
@Prop() renderer: import('stencil-apollo').QueryRenderer<FeedQuery, FeedQueryVariables>; | ||
render() { | ||
return <apollo-query query={ FeedDocument } renderer={ this.renderer } />; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// tslint:disable | ||
import * as Types from './types.d'; | ||
|
||
import gql from 'graphql-tag'; | ||
import 'stencil-apollo'; | ||
import { Component, Prop, h } from '@stencil/core'; | ||
|
||
declare global { | ||
export type SubmitRepositoryMutationVariables = { | ||
repoFullName: Types.Scalars['String'] | ||
}; | ||
|
||
|
||
export type SubmitRepositoryMutation = ({ __typename?: 'Mutation' } & { submitRepository: Types.Maybe<({ __typename?: 'Entry' } & Pick<Types.Entry, 'createdAt'>)> }); | ||
|
||
} | ||
|
||
|
||
const SubmitRepositoryDocument = gql` | ||
mutation submitRepository($repoFullName: String!) { | ||
submitRepository(repoFullName: $repoFullName) { | ||
createdAt | ||
} | ||
} | ||
`; | ||
|
||
@Component({ | ||
tag: 'apollo-submit-repository' | ||
}) | ||
export class SubmitRepositoryComponent { | ||
@Prop() renderer: import('stencil-apollo').MutationRenderer<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>; | ||
render() { | ||
return <apollo-mutation mutation={ SubmitRepositoryDocument } renderer={ this.renderer } />; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// tslint:disable | ||
import * as Types from './types.d'; | ||
|
||
import gql from 'graphql-tag'; | ||
|
||
declare global { | ||
export type RepoInfoFragment = ({ __typename?: 'Entry' } & Pick<Types.Entry, 'createdAt'> & { repository: ({ __typename?: 'Repository' } & Pick<Types.Repository, 'description' | 'stargazers_count' | 'open_issues_count'>), postedBy: ({ __typename?: 'User' } & Pick<Types.User, 'html_url' | 'login'>) }); | ||
|
||
} | ||
|
||
export const RepoInfoFragmentDoc = gql` | ||
fragment RepoInfo on Entry { | ||
createdAt | ||
repository { | ||
description | ||
stargazers_count | ||
open_issues_count | ||
} | ||
postedBy { | ||
html_url | ||
login | ||
} | ||
} | ||
`; |
38 changes: 38 additions & 0 deletions
38
dev-test/githunt/submit-comment.mutation.stencil-component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// tslint:disable | ||
import * as Types from './types.d'; | ||
|
||
import gql from 'graphql-tag'; | ||
import { CommentsPageCommentFragmentDoc } from './comments-page-comment.fragment.stencil-component'; | ||
import 'stencil-apollo'; | ||
import { Component, Prop, h } from '@stencil/core'; | ||
|
||
declare global { | ||
export type SubmitCommentMutationVariables = { | ||
repoFullName: Types.Scalars['String'], | ||
commentContent: Types.Scalars['String'] | ||
}; | ||
|
||
|
||
export type SubmitCommentMutation = ({ __typename?: 'Mutation' } & { submitComment: Types.Maybe<({ __typename?: 'Comment' } & CommentsPageCommentFragment)> }); | ||
|
||
} | ||
|
||
|
||
const SubmitCommentDocument = gql` | ||
mutation submitComment($repoFullName: String!, $commentContent: String!) { | ||
submitComment(repoFullName: $repoFullName, commentContent: $commentContent) { | ||
...CommentsPageComment | ||
} | ||
} | ||
${CommentsPageCommentFragmentDoc}`; | ||
|
||
@Component({ | ||
tag: 'apollo-submit-comment' | ||
}) | ||
export class SubmitCommentComponent { | ||
@Prop() renderer: import('stencil-apollo').MutationRenderer<SubmitCommentMutation, SubmitCommentMutationVariables>; | ||
render() { | ||
return <apollo-mutation mutation={ SubmitCommentDocument } renderer={ this.renderer } />; | ||
} | ||
} | ||
|
Oops, something went wrong.