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.
Files changed (124) hide show
  1. package/README.md +5 -0
  2. package/build/main/config.d.ts +27 -0
  3. package/build/main/config.js +3 -0
  4. package/build/main/index.d.ts +6 -0
  5. package/build/main/index.js +35 -0
  6. package/build/main/visitor.d.ts +30 -0
  7. package/build/main/visitor.js +160 -0
  8. package/build/module/config.d.ts +27 -0
  9. package/build/module/config.js +2 -0
  10. package/build/module/index.d.ts +6 -0
  11. package/build/module/index.js +30 -0
  12. package/build/module/visitor.d.ts +30 -0
  13. package/build/module/visitor.js +153 -0
  14. package/package.json +5 -2
  15. package/.editorconfig +0 -13
  16. package/.eslintrc.js +0 -63
  17. package/.github/CONTRIBUTING.md +0 -3
  18. package/.github/ISSUE_TEMPLATE.md +0 -9
  19. package/.github/PULL_REQUEST_TEMPLATE.md +0 -7
  20. package/.github/workflows/main.yml +0 -28
  21. package/.gitignore +0 -8
  22. package/.prettierignore +0 -3
  23. package/.prettierrc.json +0 -4
  24. package/.vscode/extensions.json +0 -8
  25. package/.vscode/launch.json +0 -29
  26. package/.vscode/settings.json +0 -41
  27. package/dev-test/.env +0 -1
  28. package/dev-test/codegen.yml +0 -357
  29. package/dev-test/githunt/__generated__/comment-added.subscription.stencil-component.tsx +0 -47
  30. package/dev-test/githunt/__generated__/comment.query.stencil-component.tsx +0 -68
  31. package/dev-test/githunt/__generated__/comments-page-comment.fragment.stencil-component.tsx +0 -20
  32. package/dev-test/githunt/__generated__/current-user.query.stencil-component.tsx +0 -34
  33. package/dev-test/githunt/__generated__/feed-entry.fragment.stencil-component.tsx +0 -30
  34. package/dev-test/githunt/__generated__/feed.query.stencil-component.tsx +0 -40
  35. package/dev-test/githunt/__generated__/new-entry.mutation.stencil-component.tsx +0 -35
  36. package/dev-test/githunt/__generated__/repo-info.fragment.stencil-component.tsx +0 -26
  37. package/dev-test/githunt/__generated__/submit-comment.mutation.stencil-component.tsx +0 -35
  38. package/dev-test/githunt/__generated__/vote-buttons.fragment.stencil-component.tsx +0 -16
  39. package/dev-test/githunt/__generated__/vote.mutation.stencil-component.tsx +0 -41
  40. package/dev-test/githunt/comment-added.subscription.graphql +0 -11
  41. package/dev-test/githunt/comment.query.graphql +0 -33
  42. package/dev-test/githunt/comments-page-comment.fragment.graphql +0 -9
  43. package/dev-test/githunt/current-user.query.graphql +0 -6
  44. package/dev-test/githunt/feed-entry.fragment.graphql +0 -13
  45. package/dev-test/githunt/feed.query.graphql +0 -8
  46. package/dev-test/githunt/flow.flow.js +0 -367
  47. package/dev-test/githunt/graphql-declared-modules.d.ts +0 -87
  48. package/dev-test/githunt/new-entry.mutation.graphql +0 -5
  49. package/dev-test/githunt/repo-info.fragment.graphql +0 -12
  50. package/dev-test/githunt/schema.js +0 -3
  51. package/dev-test/githunt/schema.json +0 -1750
  52. package/dev-test/githunt/submit-comment.mutation.graphql +0 -5
  53. package/dev-test/githunt/typed-document-nodes.ts +0 -892
  54. package/dev-test/githunt/types.apolloAngular.sdk.ts +0 -570
  55. package/dev-test/githunt/types.apolloAngular.ts +0 -491
  56. package/dev-test/githunt/types.avoidOptionals.ts +0 -266
  57. package/dev-test/githunt/types.d.ts +0 -261
  58. package/dev-test/githunt/types.enumsAsTypes.ts +0 -261
  59. package/dev-test/githunt/types.flatten.preResolveTypes.ts +0 -289
  60. package/dev-test/githunt/types.immutableTypes.ts +0 -267
  61. package/dev-test/githunt/types.preResolveTypes.compatibility.ts +0 -368
  62. package/dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts +0 -156
  63. package/dev-test/githunt/types.preResolveTypes.ts +0 -293
  64. package/dev-test/githunt/types.reactApollo.customSuffix.tsx +0 -634
  65. package/dev-test/githunt/types.reactApollo.hooks.tsx +0 -621
  66. package/dev-test/githunt/types.reactApollo.preResolveTypes.tsx +0 -648
  67. package/dev-test/githunt/types.reactApollo.tsx +0 -621
  68. package/dev-test/githunt/types.reactApollo.v2.tsx +0 -635
  69. package/dev-test/githunt/types.stencilApollo.tsx +0 -484
  70. package/dev-test/githunt/types.ts +0 -266
  71. package/dev-test/githunt/types.urql.tsx +0 -444
  72. package/dev-test/githunt/types.vueApollo.ts +0 -647
  73. package/dev-test/githunt/vote-buttons.fragment.graphql +0 -6
  74. package/dev-test/githunt/vote.mutation.graphql +0 -9
  75. package/dev-test/setup.js +0 -3
  76. package/dev-test/test-message/documents.ts +0 -46
  77. package/dev-test/test-message/schema.graphql +0 -23
  78. package/dev-test/test-message/types.tsx +0 -237
  79. package/dev-test/test-schema/env.types.ts +0 -35
  80. package/dev-test/test-schema/flow-types.flow.js +0 -139
  81. package/dev-test/test-schema/local/schema-ast.js +0 -2
  82. package/dev-test/test-schema/local/schema-formats.js +0 -20
  83. package/dev-test/test-schema/local/schema-object.js +0 -2
  84. package/dev-test/test-schema/local/schema-text.js +0 -2
  85. package/dev-test/test-schema/local/schema.graphql +0 -8
  86. package/dev-test/test-schema/resolvers-federation.ts +0 -233
  87. package/dev-test/test-schema/resolvers-root.ts +0 -178
  88. package/dev-test/test-schema/resolvers-types.ts +0 -168
  89. package/dev-test/test-schema/schema-ast.js +0 -2
  90. package/dev-test/test-schema/schema-federation.graphql +0 -30
  91. package/dev-test/test-schema/schema-formats.js +0 -38
  92. package/dev-test/test-schema/schema-json.js +0 -2
  93. package/dev-test/test-schema/schema-object.js +0 -2
  94. package/dev-test/test-schema/schema-text.js +0 -2
  95. package/dev-test/test-schema/schema-with-imports.graphql +0 -9
  96. package/dev-test/test-schema/schema-with-root.graphql +0 -22
  97. package/dev-test/test-schema/schema.graphql +0 -19
  98. package/dev-test/test-schema/schema.json +0 -1070
  99. package/dev-test/test-schema/types.preResolveTypes.onlyOperationTypes.ts +0 -19
  100. package/dev-test/test-schema/types.preResolveTypes.ts +0 -44
  101. package/dev-test/test-schema/typings.avoidOptionals.ts +0 -27
  102. package/dev-test/test-schema/typings.enum.ts +0 -19
  103. package/dev-test/test-schema/typings.immutableTypes.ts +0 -27
  104. package/dev-test/test-schema/typings.ts +0 -156
  105. package/dev-test/test-schema/typings.wrapped.ts +0 -29
  106. package/dev-test/tsconfig.json +0 -18
  107. package/jest.config.js +0 -30
  108. package/renovate.json +0 -2
  109. package/src/config.ts +0 -29
  110. package/src/index.ts +0 -54
  111. package/src/visitor.ts +0 -259
  112. package/tests/outputs/autogenSWRKey.ts +0 -46
  113. package/tests/outputs/excludeQueries.ts +0 -13
  114. package/tests/outputs/infinite.ts +0 -49
  115. package/tests/outputs/mutations.ts +0 -19
  116. package/tests/outputs/rawRequest.ts +0 -19
  117. package/tests/outputs/straight.ts +0 -19
  118. package/tests/swr.spec.ts +0 -306
  119. package/tests/visitor.spec.ts +0 -19
  120. package/tsconfig.json +0 -32
  121. package/tsconfig.main.json +0 -11
  122. package/tsconfig.module.json +0 -13
  123. package/yarn-error.log +0 -5477
  124. 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,11 +0,0 @@
1
- subscription onCommentAdded($repoFullName: String!) {
2
- commentAdded(repoFullName: $repoFullName) {
3
- id
4
- postedBy {
5
- login
6
- html_url
7
- }
8
- createdAt
9
- content
10
- }
11
- }
@@ -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
- }
@@ -1,9 +0,0 @@
1
- fragment CommentsPageComment on Comment {
2
- id
3
- postedBy {
4
- login
5
- html_url
6
- }
7
- createdAt
8
- content
9
- }
@@ -1,6 +0,0 @@
1
- query CurrentUserForProfile {
2
- currentUser {
3
- login
4
- avatar_url
5
- }
6
- }
@@ -1,13 +0,0 @@
1
- fragment FeedEntry on Entry {
2
- id
3
- commentCount
4
- repository {
5
- full_name
6
- html_url
7
- owner {
8
- avatar_url
9
- }
10
- }
11
- ...VoteButtons
12
- ...RepoInfo
13
- }
@@ -1,8 +0,0 @@
1
- query Feed($type: FeedType!, $offset: Int, $limit: Int) {
2
- currentUser {
3
- login
4
- }
5
- feed(type: $type, offset: $offset, limit: $limit) {
6
- ...FeedEntry
7
- }
8
- }