graphql-codegen-plugin-typescript-swr 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/build/main/config.d.ts +27 -0
- package/build/main/config.js +3 -0
- package/build/main/index.d.ts +6 -0
- package/build/main/index.js +35 -0
- package/build/main/visitor.d.ts +30 -0
- package/build/main/visitor.js +160 -0
- package/build/module/config.d.ts +27 -0
- package/build/module/config.js +2 -0
- package/build/module/index.d.ts +6 -0
- package/build/module/index.js +30 -0
- package/build/module/visitor.d.ts +30 -0
- package/build/module/visitor.js +153 -0
- package/package.json +5 -2
- package/.editorconfig +0 -13
- package/.eslintrc.js +0 -63
- package/.github/CONTRIBUTING.md +0 -3
- package/.github/ISSUE_TEMPLATE.md +0 -9
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -7
- package/.github/workflows/main.yml +0 -28
- package/.gitignore +0 -8
- package/.prettierignore +0 -3
- package/.prettierrc.json +0 -4
- package/.vscode/extensions.json +0 -8
- package/.vscode/launch.json +0 -29
- package/.vscode/settings.json +0 -41
- package/dev-test/.env +0 -1
- package/dev-test/codegen.yml +0 -357
- package/dev-test/githunt/__generated__/comment-added.subscription.stencil-component.tsx +0 -47
- package/dev-test/githunt/__generated__/comment.query.stencil-component.tsx +0 -68
- package/dev-test/githunt/__generated__/comments-page-comment.fragment.stencil-component.tsx +0 -20
- package/dev-test/githunt/__generated__/current-user.query.stencil-component.tsx +0 -34
- package/dev-test/githunt/__generated__/feed-entry.fragment.stencil-component.tsx +0 -30
- package/dev-test/githunt/__generated__/feed.query.stencil-component.tsx +0 -40
- package/dev-test/githunt/__generated__/new-entry.mutation.stencil-component.tsx +0 -35
- package/dev-test/githunt/__generated__/repo-info.fragment.stencil-component.tsx +0 -26
- package/dev-test/githunt/__generated__/submit-comment.mutation.stencil-component.tsx +0 -35
- package/dev-test/githunt/__generated__/vote-buttons.fragment.stencil-component.tsx +0 -16
- package/dev-test/githunt/__generated__/vote.mutation.stencil-component.tsx +0 -41
- package/dev-test/githunt/comment-added.subscription.graphql +0 -11
- package/dev-test/githunt/comment.query.graphql +0 -33
- package/dev-test/githunt/comments-page-comment.fragment.graphql +0 -9
- package/dev-test/githunt/current-user.query.graphql +0 -6
- package/dev-test/githunt/feed-entry.fragment.graphql +0 -13
- package/dev-test/githunt/feed.query.graphql +0 -8
- package/dev-test/githunt/flow.flow.js +0 -367
- package/dev-test/githunt/graphql-declared-modules.d.ts +0 -87
- package/dev-test/githunt/new-entry.mutation.graphql +0 -5
- package/dev-test/githunt/repo-info.fragment.graphql +0 -12
- package/dev-test/githunt/schema.js +0 -3
- package/dev-test/githunt/schema.json +0 -1750
- package/dev-test/githunt/submit-comment.mutation.graphql +0 -5
- package/dev-test/githunt/typed-document-nodes.ts +0 -892
- package/dev-test/githunt/types.apolloAngular.sdk.ts +0 -570
- package/dev-test/githunt/types.apolloAngular.ts +0 -491
- package/dev-test/githunt/types.avoidOptionals.ts +0 -266
- package/dev-test/githunt/types.d.ts +0 -261
- package/dev-test/githunt/types.enumsAsTypes.ts +0 -261
- package/dev-test/githunt/types.flatten.preResolveTypes.ts +0 -289
- package/dev-test/githunt/types.immutableTypes.ts +0 -267
- package/dev-test/githunt/types.preResolveTypes.compatibility.ts +0 -368
- package/dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts +0 -156
- package/dev-test/githunt/types.preResolveTypes.ts +0 -293
- package/dev-test/githunt/types.reactApollo.customSuffix.tsx +0 -634
- package/dev-test/githunt/types.reactApollo.hooks.tsx +0 -621
- package/dev-test/githunt/types.reactApollo.preResolveTypes.tsx +0 -648
- package/dev-test/githunt/types.reactApollo.tsx +0 -621
- package/dev-test/githunt/types.reactApollo.v2.tsx +0 -635
- package/dev-test/githunt/types.stencilApollo.tsx +0 -484
- package/dev-test/githunt/types.ts +0 -266
- package/dev-test/githunt/types.urql.tsx +0 -444
- package/dev-test/githunt/types.vueApollo.ts +0 -647
- package/dev-test/githunt/vote-buttons.fragment.graphql +0 -6
- package/dev-test/githunt/vote.mutation.graphql +0 -9
- package/dev-test/setup.js +0 -3
- package/dev-test/test-message/documents.ts +0 -46
- package/dev-test/test-message/schema.graphql +0 -23
- package/dev-test/test-message/types.tsx +0 -237
- package/dev-test/test-schema/env.types.ts +0 -35
- package/dev-test/test-schema/flow-types.flow.js +0 -139
- package/dev-test/test-schema/local/schema-ast.js +0 -2
- package/dev-test/test-schema/local/schema-formats.js +0 -20
- package/dev-test/test-schema/local/schema-object.js +0 -2
- package/dev-test/test-schema/local/schema-text.js +0 -2
- package/dev-test/test-schema/local/schema.graphql +0 -8
- package/dev-test/test-schema/resolvers-federation.ts +0 -233
- package/dev-test/test-schema/resolvers-root.ts +0 -178
- package/dev-test/test-schema/resolvers-types.ts +0 -168
- package/dev-test/test-schema/schema-ast.js +0 -2
- package/dev-test/test-schema/schema-federation.graphql +0 -30
- package/dev-test/test-schema/schema-formats.js +0 -38
- package/dev-test/test-schema/schema-json.js +0 -2
- package/dev-test/test-schema/schema-object.js +0 -2
- package/dev-test/test-schema/schema-text.js +0 -2
- package/dev-test/test-schema/schema-with-imports.graphql +0 -9
- package/dev-test/test-schema/schema-with-root.graphql +0 -22
- package/dev-test/test-schema/schema.graphql +0 -19
- package/dev-test/test-schema/schema.json +0 -1070
- package/dev-test/test-schema/types.preResolveTypes.onlyOperationTypes.ts +0 -19
- package/dev-test/test-schema/types.preResolveTypes.ts +0 -44
- package/dev-test/test-schema/typings.avoidOptionals.ts +0 -27
- package/dev-test/test-schema/typings.enum.ts +0 -19
- package/dev-test/test-schema/typings.immutableTypes.ts +0 -27
- package/dev-test/test-schema/typings.ts +0 -156
- package/dev-test/test-schema/typings.wrapped.ts +0 -29
- package/dev-test/tsconfig.json +0 -18
- package/jest.config.js +0 -30
- package/renovate.json +0 -2
- package/src/config.ts +0 -29
- package/src/index.ts +0 -54
- package/src/visitor.ts +0 -259
- package/tests/outputs/autogenSWRKey.ts +0 -46
- package/tests/outputs/excludeQueries.ts +0 -13
- package/tests/outputs/infinite.ts +0 -49
- package/tests/outputs/mutations.ts +0 -19
- package/tests/outputs/rawRequest.ts +0 -19
- package/tests/outputs/straight.ts +0 -19
- package/tests/swr.spec.ts +0 -306
- package/tests/visitor.spec.ts +0 -19
- package/tsconfig.json +0 -32
- package/tsconfig.main.json +0 -11
- package/tsconfig.module.json +0 -13
- package/yarn-error.log +0 -5477
- package/yarn.lock +0 -5359
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag';
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
export type CommentsPageCommentFragment = { __typename?: 'Comment' } & Pick<
|
|
5
|
-
Types.Comment,
|
|
6
|
-
'id' | 'createdAt' | 'content'
|
|
7
|
-
> & { postedBy: { __typename?: 'User' } & Pick<Types.User, 'login' | 'html_url'> };
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const CommentsPageCommentFragmentDoc = gql`
|
|
11
|
-
fragment CommentsPageComment on Comment {
|
|
12
|
-
id
|
|
13
|
-
postedBy {
|
|
14
|
-
login
|
|
15
|
-
html_url
|
|
16
|
-
}
|
|
17
|
-
createdAt
|
|
18
|
-
content
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag';
|
|
2
|
-
import 'stencil-apollo';
|
|
3
|
-
import { Component, Prop, h } from '@stencil/core';
|
|
4
|
-
|
|
5
|
-
declare global {
|
|
6
|
-
export type CurrentUserForProfileQueryVariables = Types.Exact<{ [key: string]: never }>;
|
|
7
|
-
|
|
8
|
-
export type CurrentUserForProfileQuery = { __typename?: 'Query' } & {
|
|
9
|
-
currentUser?: Types.Maybe<{ __typename?: 'User' } & Pick<Types.User, 'login' | 'avatar_url'>>;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const CurrentUserForProfileDocument = gql`
|
|
14
|
-
query CurrentUserForProfile {
|
|
15
|
-
currentUser {
|
|
16
|
-
login
|
|
17
|
-
avatar_url
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
@Component({
|
|
23
|
-
tag: 'apollo-current-user-for-profile',
|
|
24
|
-
})
|
|
25
|
-
export class CurrentUserForProfileComponent {
|
|
26
|
-
@Prop() renderer: import('stencil-apollo').QueryRenderer<
|
|
27
|
-
CurrentUserForProfileQuery,
|
|
28
|
-
CurrentUserForProfileQueryVariables
|
|
29
|
-
>;
|
|
30
|
-
@Prop() variables: CurrentUserForProfileQueryVariables;
|
|
31
|
-
render() {
|
|
32
|
-
return <apollo-query query={CurrentUserForProfileDocument} variables={this.variables} renderer={this.renderer} />;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag';
|
|
2
|
-
import { VoteButtonsFragmentDoc } from './vote-buttons.fragment.stencil-component';
|
|
3
|
-
import { RepoInfoFragmentDoc } from './repo-info.fragment.stencil-component';
|
|
4
|
-
|
|
5
|
-
declare global {
|
|
6
|
-
export type FeedEntryFragment = { __typename?: 'Entry' } & Pick<Types.Entry, 'id' | 'commentCount'> & {
|
|
7
|
-
repository: { __typename?: 'Repository' } & Pick<Types.Repository, 'full_name' | 'html_url'> & {
|
|
8
|
-
owner?: Types.Maybe<{ __typename?: 'User' } & Pick<Types.User, 'avatar_url'>>;
|
|
9
|
-
};
|
|
10
|
-
} & VoteButtonsFragment &
|
|
11
|
-
RepoInfoFragment;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const FeedEntryFragmentDoc = gql`
|
|
15
|
-
fragment FeedEntry on Entry {
|
|
16
|
-
id
|
|
17
|
-
commentCount
|
|
18
|
-
repository {
|
|
19
|
-
full_name
|
|
20
|
-
html_url
|
|
21
|
-
owner {
|
|
22
|
-
avatar_url
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
...VoteButtons
|
|
26
|
-
...RepoInfo
|
|
27
|
-
}
|
|
28
|
-
${VoteButtonsFragmentDoc}
|
|
29
|
-
${RepoInfoFragmentDoc}
|
|
30
|
-
`;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag';
|
|
2
|
-
import { FeedEntryFragmentDoc } from './feed-entry.fragment.stencil-component';
|
|
3
|
-
import 'stencil-apollo';
|
|
4
|
-
import { Component, Prop, h } from '@stencil/core';
|
|
5
|
-
|
|
6
|
-
declare global {
|
|
7
|
-
export type FeedQueryVariables = Types.Exact<{
|
|
8
|
-
type: Types.FeedType;
|
|
9
|
-
offset?: Types.Maybe<Types.Scalars['Int']>;
|
|
10
|
-
limit?: Types.Maybe<Types.Scalars['Int']>;
|
|
11
|
-
}>;
|
|
12
|
-
|
|
13
|
-
export type FeedQuery = { __typename?: 'Query' } & {
|
|
14
|
-
currentUser?: Types.Maybe<{ __typename?: 'User' } & Pick<Types.User, 'login'>>;
|
|
15
|
-
feed?: Types.Maybe<Array<Types.Maybe<{ __typename?: 'Entry' } & FeedEntryFragment>>>;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const FeedDocument = gql`
|
|
20
|
-
query Feed($type: FeedType!, $offset: Int, $limit: Int) {
|
|
21
|
-
currentUser {
|
|
22
|
-
login
|
|
23
|
-
}
|
|
24
|
-
feed(type: $type, offset: $offset, limit: $limit) {
|
|
25
|
-
...FeedEntry
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
${FeedEntryFragmentDoc}
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
@Component({
|
|
32
|
-
tag: 'apollo-feed',
|
|
33
|
-
})
|
|
34
|
-
export class FeedComponent {
|
|
35
|
-
@Prop() renderer: import('stencil-apollo').QueryRenderer<FeedQuery, FeedQueryVariables>;
|
|
36
|
-
@Prop() variables: FeedQueryVariables;
|
|
37
|
-
render() {
|
|
38
|
-
return <apollo-query query={FeedDocument} variables={this.variables} renderer={this.renderer} />;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag';
|
|
2
|
-
import 'stencil-apollo';
|
|
3
|
-
import { Component, Prop, h } from '@stencil/core';
|
|
4
|
-
|
|
5
|
-
declare global {
|
|
6
|
-
export type SubmitRepositoryMutationVariables = Types.Exact<{
|
|
7
|
-
repoFullName: Types.Scalars['String'];
|
|
8
|
-
}>;
|
|
9
|
-
|
|
10
|
-
export type SubmitRepositoryMutation = { __typename?: 'Mutation' } & {
|
|
11
|
-
submitRepository?: Types.Maybe<{ __typename?: 'Entry' } & Pick<Types.Entry, 'createdAt'>>;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const SubmitRepositoryDocument = gql`
|
|
16
|
-
mutation submitRepository($repoFullName: String!) {
|
|
17
|
-
submitRepository(repoFullName: $repoFullName) {
|
|
18
|
-
createdAt
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
@Component({
|
|
24
|
-
tag: 'apollo-submit-repository',
|
|
25
|
-
})
|
|
26
|
-
export class SubmitRepositoryComponent {
|
|
27
|
-
@Prop() renderer: import('stencil-apollo').MutationRenderer<
|
|
28
|
-
SubmitRepositoryMutation,
|
|
29
|
-
SubmitRepositoryMutationVariables
|
|
30
|
-
>;
|
|
31
|
-
@Prop() variables: SubmitRepositoryMutationVariables;
|
|
32
|
-
render() {
|
|
33
|
-
return <apollo-mutation mutation={SubmitRepositoryDocument} variables={this.variables} renderer={this.renderer} />;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag';
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
export type RepoInfoFragment = { __typename?: 'Entry' } & Pick<Types.Entry, 'createdAt'> & {
|
|
5
|
-
repository: { __typename?: 'Repository' } & Pick<
|
|
6
|
-
Types.Repository,
|
|
7
|
-
'description' | 'stargazers_count' | 'open_issues_count'
|
|
8
|
-
>;
|
|
9
|
-
postedBy: { __typename?: 'User' } & Pick<Types.User, 'html_url' | 'login'>;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const RepoInfoFragmentDoc = gql`
|
|
14
|
-
fragment RepoInfo on Entry {
|
|
15
|
-
createdAt
|
|
16
|
-
repository {
|
|
17
|
-
description
|
|
18
|
-
stargazers_count
|
|
19
|
-
open_issues_count
|
|
20
|
-
}
|
|
21
|
-
postedBy {
|
|
22
|
-
html_url
|
|
23
|
-
login
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag';
|
|
2
|
-
import { CommentsPageCommentFragmentDoc } from './comments-page-comment.fragment.stencil-component';
|
|
3
|
-
import 'stencil-apollo';
|
|
4
|
-
import { Component, Prop, h } from '@stencil/core';
|
|
5
|
-
|
|
6
|
-
declare global {
|
|
7
|
-
export type SubmitCommentMutationVariables = Types.Exact<{
|
|
8
|
-
repoFullName: Types.Scalars['String'];
|
|
9
|
-
commentContent: Types.Scalars['String'];
|
|
10
|
-
}>;
|
|
11
|
-
|
|
12
|
-
export type SubmitCommentMutation = { __typename?: 'Mutation' } & {
|
|
13
|
-
submitComment?: Types.Maybe<{ __typename?: 'Comment' } & CommentsPageCommentFragment>;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const SubmitCommentDocument = gql`
|
|
18
|
-
mutation submitComment($repoFullName: String!, $commentContent: String!) {
|
|
19
|
-
submitComment(repoFullName: $repoFullName, commentContent: $commentContent) {
|
|
20
|
-
...CommentsPageComment
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
${CommentsPageCommentFragmentDoc}
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
@Component({
|
|
27
|
-
tag: 'apollo-submit-comment',
|
|
28
|
-
})
|
|
29
|
-
export class SubmitCommentComponent {
|
|
30
|
-
@Prop() renderer: import('stencil-apollo').MutationRenderer<SubmitCommentMutation, SubmitCommentMutationVariables>;
|
|
31
|
-
@Prop() variables: SubmitCommentMutationVariables;
|
|
32
|
-
render() {
|
|
33
|
-
return <apollo-mutation mutation={SubmitCommentDocument} variables={this.variables} renderer={this.renderer} />;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag';
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
export type VoteButtonsFragment = { __typename?: 'Entry' } & Pick<Types.Entry, 'score'> & {
|
|
5
|
-
vote: { __typename?: 'Vote' } & Pick<Types.Vote, 'vote_value'>;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const VoteButtonsFragmentDoc = gql`
|
|
10
|
-
fragment VoteButtons on Entry {
|
|
11
|
-
score
|
|
12
|
-
vote {
|
|
13
|
-
vote_value
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag';
|
|
2
|
-
import 'stencil-apollo';
|
|
3
|
-
import { Component, Prop, h } from '@stencil/core';
|
|
4
|
-
|
|
5
|
-
declare global {
|
|
6
|
-
export type VoteMutationVariables = Types.Exact<{
|
|
7
|
-
repoFullName: Types.Scalars['String'];
|
|
8
|
-
type: Types.VoteType;
|
|
9
|
-
}>;
|
|
10
|
-
|
|
11
|
-
export type VoteMutation = { __typename?: 'Mutation' } & {
|
|
12
|
-
vote?: Types.Maybe<
|
|
13
|
-
{ __typename?: 'Entry' } & Pick<Types.Entry, 'score' | 'id'> & {
|
|
14
|
-
vote: { __typename?: 'Vote' } & Pick<Types.Vote, 'vote_value'>;
|
|
15
|
-
}
|
|
16
|
-
>;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const VoteDocument = gql`
|
|
21
|
-
mutation vote($repoFullName: String!, $type: VoteType!) {
|
|
22
|
-
vote(repoFullName: $repoFullName, type: $type) {
|
|
23
|
-
score
|
|
24
|
-
id
|
|
25
|
-
vote {
|
|
26
|
-
vote_value
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
@Component({
|
|
33
|
-
tag: 'apollo-vote',
|
|
34
|
-
})
|
|
35
|
-
export class VoteComponent {
|
|
36
|
-
@Prop() renderer: import('stencil-apollo').MutationRenderer<VoteMutation, VoteMutationVariables>;
|
|
37
|
-
@Prop() variables: VoteMutationVariables;
|
|
38
|
-
render() {
|
|
39
|
-
return <apollo-mutation mutation={VoteDocument} variables={this.variables} renderer={this.renderer} />;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# import './comments-page-comment.fragment.graphql'
|
|
2
|
-
|
|
3
|
-
query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
|
|
4
|
-
# Eventually move this into a no fetch query right on the entry
|
|
5
|
-
# since we literally just need this info to determine whether to
|
|
6
|
-
# show upvote/downvote buttons
|
|
7
|
-
currentUser {
|
|
8
|
-
login
|
|
9
|
-
html_url
|
|
10
|
-
}
|
|
11
|
-
entry(repoFullName: $repoFullName) {
|
|
12
|
-
id
|
|
13
|
-
postedBy {
|
|
14
|
-
login
|
|
15
|
-
html_url
|
|
16
|
-
}
|
|
17
|
-
createdAt
|
|
18
|
-
comments(limit: $limit, offset: $offset) {
|
|
19
|
-
...CommentsPageComment
|
|
20
|
-
}
|
|
21
|
-
commentCount
|
|
22
|
-
repository {
|
|
23
|
-
full_name
|
|
24
|
-
html_url
|
|
25
|
-
|
|
26
|
-
... on Repository {
|
|
27
|
-
description
|
|
28
|
-
open_issues_count
|
|
29
|
-
stargazers_count
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|