graphql-codegen-plugin-typescript-swr 0.8.5 → 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 (113) hide show
  1. package/README.md +5 -0
  2. package/package.json +5 -2
  3. package/.editorconfig +0 -13
  4. package/.eslintrc.js +0 -63
  5. package/.github/CONTRIBUTING.md +0 -3
  6. package/.github/ISSUE_TEMPLATE.md +0 -9
  7. package/.github/PULL_REQUEST_TEMPLATE.md +0 -7
  8. package/.github/workflows/main.yml +0 -28
  9. package/.gitignore +0 -8
  10. package/.prettierignore +0 -3
  11. package/.prettierrc.json +0 -4
  12. package/.vscode/extensions.json +0 -8
  13. package/.vscode/launch.json +0 -29
  14. package/.vscode/settings.json +0 -41
  15. package/build/tsconfig.main.tsbuildinfo +0 -1
  16. package/build/tsconfig.module.tsbuildinfo +0 -1
  17. package/dev-test/.env +0 -1
  18. package/dev-test/codegen.yml +0 -357
  19. package/dev-test/githunt/__generated__/comment-added.subscription.stencil-component.tsx +0 -47
  20. package/dev-test/githunt/__generated__/comment.query.stencil-component.tsx +0 -68
  21. package/dev-test/githunt/__generated__/comments-page-comment.fragment.stencil-component.tsx +0 -20
  22. package/dev-test/githunt/__generated__/current-user.query.stencil-component.tsx +0 -34
  23. package/dev-test/githunt/__generated__/feed-entry.fragment.stencil-component.tsx +0 -30
  24. package/dev-test/githunt/__generated__/feed.query.stencil-component.tsx +0 -40
  25. package/dev-test/githunt/__generated__/new-entry.mutation.stencil-component.tsx +0 -35
  26. package/dev-test/githunt/__generated__/repo-info.fragment.stencil-component.tsx +0 -26
  27. package/dev-test/githunt/__generated__/submit-comment.mutation.stencil-component.tsx +0 -35
  28. package/dev-test/githunt/__generated__/vote-buttons.fragment.stencil-component.tsx +0 -16
  29. package/dev-test/githunt/__generated__/vote.mutation.stencil-component.tsx +0 -41
  30. package/dev-test/githunt/comment-added.subscription.graphql +0 -11
  31. package/dev-test/githunt/comment.query.graphql +0 -33
  32. package/dev-test/githunt/comments-page-comment.fragment.graphql +0 -9
  33. package/dev-test/githunt/current-user.query.graphql +0 -6
  34. package/dev-test/githunt/feed-entry.fragment.graphql +0 -13
  35. package/dev-test/githunt/feed.query.graphql +0 -8
  36. package/dev-test/githunt/flow.flow.js +0 -367
  37. package/dev-test/githunt/graphql-declared-modules.d.ts +0 -87
  38. package/dev-test/githunt/new-entry.mutation.graphql +0 -5
  39. package/dev-test/githunt/repo-info.fragment.graphql +0 -12
  40. package/dev-test/githunt/schema.js +0 -3
  41. package/dev-test/githunt/schema.json +0 -1750
  42. package/dev-test/githunt/submit-comment.mutation.graphql +0 -5
  43. package/dev-test/githunt/typed-document-nodes.ts +0 -892
  44. package/dev-test/githunt/types.apolloAngular.sdk.ts +0 -570
  45. package/dev-test/githunt/types.apolloAngular.ts +0 -491
  46. package/dev-test/githunt/types.avoidOptionals.ts +0 -266
  47. package/dev-test/githunt/types.d.ts +0 -261
  48. package/dev-test/githunt/types.enumsAsTypes.ts +0 -261
  49. package/dev-test/githunt/types.flatten.preResolveTypes.ts +0 -289
  50. package/dev-test/githunt/types.immutableTypes.ts +0 -267
  51. package/dev-test/githunt/types.preResolveTypes.compatibility.ts +0 -368
  52. package/dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts +0 -156
  53. package/dev-test/githunt/types.preResolveTypes.ts +0 -293
  54. package/dev-test/githunt/types.reactApollo.customSuffix.tsx +0 -634
  55. package/dev-test/githunt/types.reactApollo.hooks.tsx +0 -621
  56. package/dev-test/githunt/types.reactApollo.preResolveTypes.tsx +0 -648
  57. package/dev-test/githunt/types.reactApollo.tsx +0 -621
  58. package/dev-test/githunt/types.reactApollo.v2.tsx +0 -635
  59. package/dev-test/githunt/types.stencilApollo.tsx +0 -484
  60. package/dev-test/githunt/types.ts +0 -266
  61. package/dev-test/githunt/types.urql.tsx +0 -444
  62. package/dev-test/githunt/types.vueApollo.ts +0 -647
  63. package/dev-test/githunt/vote-buttons.fragment.graphql +0 -6
  64. package/dev-test/githunt/vote.mutation.graphql +0 -9
  65. package/dev-test/setup.js +0 -3
  66. package/dev-test/test-message/documents.ts +0 -46
  67. package/dev-test/test-message/schema.graphql +0 -23
  68. package/dev-test/test-message/types.tsx +0 -237
  69. package/dev-test/test-schema/env.types.ts +0 -35
  70. package/dev-test/test-schema/flow-types.flow.js +0 -139
  71. package/dev-test/test-schema/local/schema-ast.js +0 -2
  72. package/dev-test/test-schema/local/schema-formats.js +0 -20
  73. package/dev-test/test-schema/local/schema-object.js +0 -2
  74. package/dev-test/test-schema/local/schema-text.js +0 -2
  75. package/dev-test/test-schema/local/schema.graphql +0 -8
  76. package/dev-test/test-schema/resolvers-federation.ts +0 -233
  77. package/dev-test/test-schema/resolvers-root.ts +0 -178
  78. package/dev-test/test-schema/resolvers-types.ts +0 -168
  79. package/dev-test/test-schema/schema-ast.js +0 -2
  80. package/dev-test/test-schema/schema-federation.graphql +0 -30
  81. package/dev-test/test-schema/schema-formats.js +0 -38
  82. package/dev-test/test-schema/schema-json.js +0 -2
  83. package/dev-test/test-schema/schema-object.js +0 -2
  84. package/dev-test/test-schema/schema-text.js +0 -2
  85. package/dev-test/test-schema/schema-with-imports.graphql +0 -9
  86. package/dev-test/test-schema/schema-with-root.graphql +0 -22
  87. package/dev-test/test-schema/schema.graphql +0 -19
  88. package/dev-test/test-schema/schema.json +0 -1070
  89. package/dev-test/test-schema/types.preResolveTypes.onlyOperationTypes.ts +0 -19
  90. package/dev-test/test-schema/types.preResolveTypes.ts +0 -44
  91. package/dev-test/test-schema/typings.avoidOptionals.ts +0 -27
  92. package/dev-test/test-schema/typings.enum.ts +0 -19
  93. package/dev-test/test-schema/typings.immutableTypes.ts +0 -27
  94. package/dev-test/test-schema/typings.ts +0 -156
  95. package/dev-test/test-schema/typings.wrapped.ts +0 -29
  96. package/dev-test/tsconfig.json +0 -18
  97. package/jest.config.js +0 -30
  98. package/renovate.json +0 -2
  99. package/src/config.ts +0 -29
  100. package/src/index.ts +0 -54
  101. package/src/visitor.ts +0 -259
  102. package/tests/outputs/autogenSWRKey.ts +0 -46
  103. package/tests/outputs/excludeQueries.ts +0 -13
  104. package/tests/outputs/infinite.ts +0 -49
  105. package/tests/outputs/mutations.ts +0 -19
  106. package/tests/outputs/rawRequest.ts +0 -19
  107. package/tests/outputs/straight.ts +0 -19
  108. package/tests/swr.spec.ts +0 -306
  109. package/tests/visitor.spec.ts +0 -19
  110. package/tsconfig.json +0 -32
  111. package/tsconfig.main.json +0 -11
  112. package/tsconfig.module.json +0 -13
  113. package/yarn.lock +0 -5359
@@ -1,266 +0,0 @@
1
- export type Maybe<T> = T | null;
2
- export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
3
- /** All built-in and custom scalars, mapped to their actual values */
4
- export type Scalars = {
5
- ID: string;
6
- String: string;
7
- Boolean: boolean;
8
- Int: number;
9
- Float: number;
10
- };
11
-
12
- export type Query = {
13
- __typename?: 'Query';
14
- /** A feed of repository submissions */
15
- feed?: Maybe<Array<Maybe<Entry>>>;
16
- /** A single entry */
17
- entry?: Maybe<Entry>;
18
- /** Return the currently logged in user, or null if nobody is logged in */
19
- currentUser?: Maybe<User>;
20
- };
21
-
22
- export type QueryFeedArgs = {
23
- type: FeedType;
24
- offset?: Maybe<Scalars['Int']>;
25
- limit?: Maybe<Scalars['Int']>;
26
- };
27
-
28
- export type QueryEntryArgs = {
29
- repoFullName: Scalars['String'];
30
- };
31
-
32
- /** A list of options for the sort order of the feed */
33
- export enum FeedType {
34
- /** Sort by a combination of freshness and score, using Reddit's algorithm */
35
- Hot = 'HOT',
36
- /** Newest entries first */
37
- New = 'NEW',
38
- /** Highest score entries first */
39
- Top = 'TOP',
40
- }
41
-
42
- /** Information about a GitHub repository submitted to GitHunt */
43
- export type Entry = {
44
- __typename?: 'Entry';
45
- /** Information about the repository from GitHub */
46
- repository: Repository;
47
- /** The GitHub user who submitted this entry */
48
- postedBy: User;
49
- /** A timestamp of when the entry was submitted */
50
- createdAt: Scalars['Float'];
51
- /** The score of this repository, upvotes - downvotes */
52
- score: Scalars['Int'];
53
- /** The hot score of this repository */
54
- hotScore: Scalars['Float'];
55
- /** Comments posted about this repository */
56
- comments: Array<Maybe<Comment>>;
57
- /** The number of comments posted about this repository */
58
- commentCount: Scalars['Int'];
59
- /** The SQL ID of this entry */
60
- id: Scalars['Int'];
61
- /** XXX to be changed */
62
- vote: Vote;
63
- };
64
-
65
- /** Information about a GitHub repository submitted to GitHunt */
66
- export type EntryCommentsArgs = {
67
- limit?: Maybe<Scalars['Int']>;
68
- offset?: Maybe<Scalars['Int']>;
69
- };
70
-
71
- /**
72
- * A repository object from the GitHub API. This uses the exact field names returned by the
73
- * GitHub API for simplicity, even though the convention for GraphQL is usually to camel case.
74
- */
75
- export type Repository = {
76
- __typename?: 'Repository';
77
- /** Just the name of the repository, e.g. GitHunt-API */
78
- name: Scalars['String'];
79
- /** The full name of the repository with the username, e.g. apollostack/GitHunt-API */
80
- full_name: Scalars['String'];
81
- /** The description of the repository */
82
- description?: Maybe<Scalars['String']>;
83
- /** The link to the repository on GitHub */
84
- html_url: Scalars['String'];
85
- /** The number of people who have starred this repository on GitHub */
86
- stargazers_count: Scalars['Int'];
87
- /** The number of open issues on this repository on GitHub */
88
- open_issues_count?: Maybe<Scalars['Int']>;
89
- /** The owner of this repository on GitHub, e.g. apollostack */
90
- owner?: Maybe<User>;
91
- };
92
-
93
- /** A user object from the GitHub API. This uses the exact field names returned from the GitHub API. */
94
- export type User = {
95
- __typename?: 'User';
96
- /** The name of the user, e.g. apollostack */
97
- login: Scalars['String'];
98
- /** The URL to a directly embeddable image for this user's avatar */
99
- avatar_url: Scalars['String'];
100
- /** The URL of this user's GitHub page */
101
- html_url: Scalars['String'];
102
- };
103
-
104
- /** A comment about an entry, submitted by a user */
105
- export type Comment = {
106
- __typename?: 'Comment';
107
- /** The SQL ID of this entry */
108
- id: Scalars['Int'];
109
- /** The GitHub user who posted the comment */
110
- postedBy: User;
111
- /** A timestamp of when the comment was posted */
112
- createdAt: Scalars['Float'];
113
- /** The text of the comment */
114
- content: Scalars['String'];
115
- /** The repository which this comment is about */
116
- repoName: Scalars['String'];
117
- };
118
-
119
- /** XXX to be removed */
120
- export type Vote = {
121
- __typename?: 'Vote';
122
- vote_value: Scalars['Int'];
123
- };
124
-
125
- export type Mutation = {
126
- __typename?: 'Mutation';
127
- /** Submit a new repository, returns the new submission */
128
- submitRepository?: Maybe<Entry>;
129
- /** Vote on a repository submission, returns the submission that was voted on */
130
- vote?: Maybe<Entry>;
131
- /** Comment on a repository, returns the new comment */
132
- submitComment?: Maybe<Comment>;
133
- };
134
-
135
- export type MutationSubmitRepositoryArgs = {
136
- repoFullName: Scalars['String'];
137
- };
138
-
139
- export type MutationVoteArgs = {
140
- repoFullName: Scalars['String'];
141
- type: VoteType;
142
- };
143
-
144
- export type MutationSubmitCommentArgs = {
145
- repoFullName: Scalars['String'];
146
- commentContent: Scalars['String'];
147
- };
148
-
149
- /** The type of vote to record, when submitting a vote */
150
- export enum VoteType {
151
- Up = 'UP',
152
- Down = 'DOWN',
153
- Cancel = 'CANCEL',
154
- }
155
-
156
- export type Subscription = {
157
- __typename?: 'Subscription';
158
- /** Subscription fires on every comment added */
159
- commentAdded?: Maybe<Comment>;
160
- };
161
-
162
- export type SubscriptionCommentAddedArgs = {
163
- repoFullName: Scalars['String'];
164
- };
165
-
166
- export type OnCommentAddedSubscriptionVariables = Exact<{
167
- repoFullName: Scalars['String'];
168
- }>;
169
-
170
- export type OnCommentAddedSubscription = { __typename?: 'Subscription' } & {
171
- commentAdded?: Maybe<
172
- { __typename?: 'Comment' } & Pick<Comment, 'id' | 'createdAt' | 'content'> & {
173
- postedBy: { __typename?: 'User' } & Pick<User, 'login' | 'html_url'>;
174
- }
175
- >;
176
- };
177
-
178
- export type CommentQueryVariables = Exact<{
179
- repoFullName: Scalars['String'];
180
- limit?: Maybe<Scalars['Int']>;
181
- offset?: Maybe<Scalars['Int']>;
182
- }>;
183
-
184
- export type CommentQuery = { __typename?: 'Query' } & {
185
- currentUser?: Maybe<{ __typename?: 'User' } & Pick<User, 'login' | 'html_url'>>;
186
- entry?: Maybe<
187
- { __typename?: 'Entry' } & Pick<Entry, 'id' | 'createdAt' | 'commentCount'> & {
188
- postedBy: { __typename?: 'User' } & Pick<User, 'login' | 'html_url'>;
189
- comments: Array<Maybe<{ __typename?: 'Comment' } & CommentsPageCommentFragment>>;
190
- repository: { __typename?: 'Repository' } & Pick<
191
- Repository,
192
- 'description' | 'open_issues_count' | 'stargazers_count' | 'full_name' | 'html_url'
193
- >;
194
- }
195
- >;
196
- };
197
-
198
- export type CommentsPageCommentFragment = { __typename?: 'Comment' } & Pick<Comment, 'id' | 'createdAt' | 'content'> & {
199
- postedBy: { __typename?: 'User' } & Pick<User, 'login' | 'html_url'>;
200
- };
201
-
202
- export type CurrentUserForProfileQueryVariables = Exact<{ [key: string]: never }>;
203
-
204
- export type CurrentUserForProfileQuery = { __typename?: 'Query' } & {
205
- currentUser?: Maybe<{ __typename?: 'User' } & Pick<User, 'login' | 'avatar_url'>>;
206
- };
207
-
208
- export type FeedEntryFragment = { __typename?: 'Entry' } & Pick<Entry, 'id' | 'commentCount'> & {
209
- repository: { __typename?: 'Repository' } & Pick<Repository, 'full_name' | 'html_url'> & {
210
- owner?: Maybe<{ __typename?: 'User' } & Pick<User, 'avatar_url'>>;
211
- };
212
- } & VoteButtonsFragment &
213
- RepoInfoFragment;
214
-
215
- export type FeedQueryVariables = Exact<{
216
- type: FeedType;
217
- offset?: Maybe<Scalars['Int']>;
218
- limit?: Maybe<Scalars['Int']>;
219
- }>;
220
-
221
- export type FeedQuery = { __typename?: 'Query' } & {
222
- currentUser?: Maybe<{ __typename?: 'User' } & Pick<User, 'login'>>;
223
- feed?: Maybe<Array<Maybe<{ __typename?: 'Entry' } & FeedEntryFragment>>>;
224
- };
225
-
226
- export type SubmitRepositoryMutationVariables = Exact<{
227
- repoFullName: Scalars['String'];
228
- }>;
229
-
230
- export type SubmitRepositoryMutation = { __typename?: 'Mutation' } & {
231
- submitRepository?: Maybe<{ __typename?: 'Entry' } & Pick<Entry, 'createdAt'>>;
232
- };
233
-
234
- export type RepoInfoFragment = { __typename?: 'Entry' } & Pick<Entry, 'createdAt'> & {
235
- repository: { __typename?: 'Repository' } & Pick<
236
- Repository,
237
- 'description' | 'stargazers_count' | 'open_issues_count'
238
- >;
239
- postedBy: { __typename?: 'User' } & Pick<User, 'html_url' | 'login'>;
240
- };
241
-
242
- export type SubmitCommentMutationVariables = Exact<{
243
- repoFullName: Scalars['String'];
244
- commentContent: Scalars['String'];
245
- }>;
246
-
247
- export type SubmitCommentMutation = { __typename?: 'Mutation' } & {
248
- submitComment?: Maybe<{ __typename?: 'Comment' } & CommentsPageCommentFragment>;
249
- };
250
-
251
- export type VoteButtonsFragment = { __typename?: 'Entry' } & Pick<Entry, 'score'> & {
252
- vote: { __typename?: 'Vote' } & Pick<Vote, 'vote_value'>;
253
- };
254
-
255
- export type VoteMutationVariables = Exact<{
256
- repoFullName: Scalars['String'];
257
- type: VoteType;
258
- }>;
259
-
260
- export type VoteMutation = { __typename?: 'Mutation' } & {
261
- vote?: Maybe<
262
- { __typename?: 'Entry' } & Pick<Entry, 'score' | 'id'> & {
263
- vote: { __typename?: 'Vote' } & Pick<Vote, 'vote_value'>;
264
- }
265
- >;
266
- };
@@ -1,444 +0,0 @@
1
- import gql from 'graphql-tag';
2
- import * as Urql from 'urql';
3
- export type Maybe<T> = T | null;
4
- export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
5
- export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
6
- /** All built-in and custom scalars, mapped to their actual values */
7
- export type Scalars = {
8
- ID: string;
9
- String: string;
10
- Boolean: boolean;
11
- Int: number;
12
- Float: number;
13
- };
14
-
15
- export type Query = {
16
- __typename?: 'Query';
17
- /** A feed of repository submissions */
18
- feed?: Maybe<Array<Maybe<Entry>>>;
19
- /** A single entry */
20
- entry?: Maybe<Entry>;
21
- /** Return the currently logged in user, or null if nobody is logged in */
22
- currentUser?: Maybe<User>;
23
- };
24
-
25
- export type QueryFeedArgs = {
26
- type: FeedType;
27
- offset?: Maybe<Scalars['Int']>;
28
- limit?: Maybe<Scalars['Int']>;
29
- };
30
-
31
- export type QueryEntryArgs = {
32
- repoFullName: Scalars['String'];
33
- };
34
-
35
- /** A list of options for the sort order of the feed */
36
- export enum FeedType {
37
- /** Sort by a combination of freshness and score, using Reddit's algorithm */
38
- Hot = 'HOT',
39
- /** Newest entries first */
40
- New = 'NEW',
41
- /** Highest score entries first */
42
- Top = 'TOP',
43
- }
44
-
45
- /** Information about a GitHub repository submitted to GitHunt */
46
- export type Entry = {
47
- __typename?: 'Entry';
48
- /** Information about the repository from GitHub */
49
- repository: Repository;
50
- /** The GitHub user who submitted this entry */
51
- postedBy: User;
52
- /** A timestamp of when the entry was submitted */
53
- createdAt: Scalars['Float'];
54
- /** The score of this repository, upvotes - downvotes */
55
- score: Scalars['Int'];
56
- /** The hot score of this repository */
57
- hotScore: Scalars['Float'];
58
- /** Comments posted about this repository */
59
- comments: Array<Maybe<Comment>>;
60
- /** The number of comments posted about this repository */
61
- commentCount: Scalars['Int'];
62
- /** The SQL ID of this entry */
63
- id: Scalars['Int'];
64
- /** XXX to be changed */
65
- vote: Vote;
66
- };
67
-
68
- /** Information about a GitHub repository submitted to GitHunt */
69
- export type EntryCommentsArgs = {
70
- limit?: Maybe<Scalars['Int']>;
71
- offset?: Maybe<Scalars['Int']>;
72
- };
73
-
74
- /**
75
- * A repository object from the GitHub API. This uses the exact field names returned by the
76
- * GitHub API for simplicity, even though the convention for GraphQL is usually to camel case.
77
- */
78
- export type Repository = {
79
- __typename?: 'Repository';
80
- /** Just the name of the repository, e.g. GitHunt-API */
81
- name: Scalars['String'];
82
- /** The full name of the repository with the username, e.g. apollostack/GitHunt-API */
83
- full_name: Scalars['String'];
84
- /** The description of the repository */
85
- description?: Maybe<Scalars['String']>;
86
- /** The link to the repository on GitHub */
87
- html_url: Scalars['String'];
88
- /** The number of people who have starred this repository on GitHub */
89
- stargazers_count: Scalars['Int'];
90
- /** The number of open issues on this repository on GitHub */
91
- open_issues_count?: Maybe<Scalars['Int']>;
92
- /** The owner of this repository on GitHub, e.g. apollostack */
93
- owner?: Maybe<User>;
94
- };
95
-
96
- /** A user object from the GitHub API. This uses the exact field names returned from the GitHub API. */
97
- export type User = {
98
- __typename?: 'User';
99
- /** The name of the user, e.g. apollostack */
100
- login: Scalars['String'];
101
- /** The URL to a directly embeddable image for this user's avatar */
102
- avatar_url: Scalars['String'];
103
- /** The URL of this user's GitHub page */
104
- html_url: Scalars['String'];
105
- };
106
-
107
- /** A comment about an entry, submitted by a user */
108
- export type Comment = {
109
- __typename?: 'Comment';
110
- /** The SQL ID of this entry */
111
- id: Scalars['Int'];
112
- /** The GitHub user who posted the comment */
113
- postedBy: User;
114
- /** A timestamp of when the comment was posted */
115
- createdAt: Scalars['Float'];
116
- /** The text of the comment */
117
- content: Scalars['String'];
118
- /** The repository which this comment is about */
119
- repoName: Scalars['String'];
120
- };
121
-
122
- /** XXX to be removed */
123
- export type Vote = {
124
- __typename?: 'Vote';
125
- vote_value: Scalars['Int'];
126
- };
127
-
128
- export type Mutation = {
129
- __typename?: 'Mutation';
130
- /** Submit a new repository, returns the new submission */
131
- submitRepository?: Maybe<Entry>;
132
- /** Vote on a repository submission, returns the submission that was voted on */
133
- vote?: Maybe<Entry>;
134
- /** Comment on a repository, returns the new comment */
135
- submitComment?: Maybe<Comment>;
136
- };
137
-
138
- export type MutationSubmitRepositoryArgs = {
139
- repoFullName: Scalars['String'];
140
- };
141
-
142
- export type MutationVoteArgs = {
143
- repoFullName: Scalars['String'];
144
- type: VoteType;
145
- };
146
-
147
- export type MutationSubmitCommentArgs = {
148
- repoFullName: Scalars['String'];
149
- commentContent: Scalars['String'];
150
- };
151
-
152
- /** The type of vote to record, when submitting a vote */
153
- export enum VoteType {
154
- Up = 'UP',
155
- Down = 'DOWN',
156
- Cancel = 'CANCEL',
157
- }
158
-
159
- export type Subscription = {
160
- __typename?: 'Subscription';
161
- /** Subscription fires on every comment added */
162
- commentAdded?: Maybe<Comment>;
163
- };
164
-
165
- export type SubscriptionCommentAddedArgs = {
166
- repoFullName: Scalars['String'];
167
- };
168
-
169
- export type OnCommentAddedSubscriptionVariables = Exact<{
170
- repoFullName: Scalars['String'];
171
- }>;
172
-
173
- export type OnCommentAddedSubscription = { __typename?: 'Subscription' } & {
174
- commentAdded?: Maybe<
175
- { __typename?: 'Comment' } & Pick<Comment, 'id' | 'createdAt' | 'content'> & {
176
- postedBy: { __typename?: 'User' } & Pick<User, 'login' | 'html_url'>;
177
- }
178
- >;
179
- };
180
-
181
- export type CommentQueryVariables = Exact<{
182
- repoFullName: Scalars['String'];
183
- limit?: Maybe<Scalars['Int']>;
184
- offset?: Maybe<Scalars['Int']>;
185
- }>;
186
-
187
- export type CommentQuery = { __typename?: 'Query' } & {
188
- currentUser?: Maybe<{ __typename?: 'User' } & Pick<User, 'login' | 'html_url'>>;
189
- entry?: Maybe<
190
- { __typename?: 'Entry' } & Pick<Entry, 'id' | 'createdAt' | 'commentCount'> & {
191
- postedBy: { __typename?: 'User' } & Pick<User, 'login' | 'html_url'>;
192
- comments: Array<Maybe<{ __typename?: 'Comment' } & CommentsPageCommentFragment>>;
193
- repository: { __typename?: 'Repository' } & Pick<
194
- Repository,
195
- 'description' | 'open_issues_count' | 'stargazers_count' | 'full_name' | 'html_url'
196
- >;
197
- }
198
- >;
199
- };
200
-
201
- export type CommentsPageCommentFragment = { __typename?: 'Comment' } & Pick<Comment, 'id' | 'createdAt' | 'content'> & {
202
- postedBy: { __typename?: 'User' } & Pick<User, 'login' | 'html_url'>;
203
- };
204
-
205
- export type CurrentUserForProfileQueryVariables = Exact<{ [key: string]: never }>;
206
-
207
- export type CurrentUserForProfileQuery = { __typename?: 'Query' } & {
208
- currentUser?: Maybe<{ __typename?: 'User' } & Pick<User, 'login' | 'avatar_url'>>;
209
- };
210
-
211
- export type FeedEntryFragment = { __typename?: 'Entry' } & Pick<Entry, 'id' | 'commentCount'> & {
212
- repository: { __typename?: 'Repository' } & Pick<Repository, 'full_name' | 'html_url'> & {
213
- owner?: Maybe<{ __typename?: 'User' } & Pick<User, 'avatar_url'>>;
214
- };
215
- } & VoteButtonsFragment &
216
- RepoInfoFragment;
217
-
218
- export type FeedQueryVariables = Exact<{
219
- type: FeedType;
220
- offset?: Maybe<Scalars['Int']>;
221
- limit?: Maybe<Scalars['Int']>;
222
- }>;
223
-
224
- export type FeedQuery = { __typename?: 'Query' } & {
225
- currentUser?: Maybe<{ __typename?: 'User' } & Pick<User, 'login'>>;
226
- feed?: Maybe<Array<Maybe<{ __typename?: 'Entry' } & FeedEntryFragment>>>;
227
- };
228
-
229
- export type SubmitRepositoryMutationVariables = Exact<{
230
- repoFullName: Scalars['String'];
231
- }>;
232
-
233
- export type SubmitRepositoryMutation = { __typename?: 'Mutation' } & {
234
- submitRepository?: Maybe<{ __typename?: 'Entry' } & Pick<Entry, 'createdAt'>>;
235
- };
236
-
237
- export type RepoInfoFragment = { __typename?: 'Entry' } & Pick<Entry, 'createdAt'> & {
238
- repository: { __typename?: 'Repository' } & Pick<
239
- Repository,
240
- 'description' | 'stargazers_count' | 'open_issues_count'
241
- >;
242
- postedBy: { __typename?: 'User' } & Pick<User, 'html_url' | 'login'>;
243
- };
244
-
245
- export type SubmitCommentMutationVariables = Exact<{
246
- repoFullName: Scalars['String'];
247
- commentContent: Scalars['String'];
248
- }>;
249
-
250
- export type SubmitCommentMutation = { __typename?: 'Mutation' } & {
251
- submitComment?: Maybe<{ __typename?: 'Comment' } & CommentsPageCommentFragment>;
252
- };
253
-
254
- export type VoteButtonsFragment = { __typename?: 'Entry' } & Pick<Entry, 'score'> & {
255
- vote: { __typename?: 'Vote' } & Pick<Vote, 'vote_value'>;
256
- };
257
-
258
- export type VoteMutationVariables = Exact<{
259
- repoFullName: Scalars['String'];
260
- type: VoteType;
261
- }>;
262
-
263
- export type VoteMutation = { __typename?: 'Mutation' } & {
264
- vote?: Maybe<
265
- { __typename?: 'Entry' } & Pick<Entry, 'score' | 'id'> & {
266
- vote: { __typename?: 'Vote' } & Pick<Vote, 'vote_value'>;
267
- }
268
- >;
269
- };
270
-
271
- export const CommentsPageCommentFragmentDoc = gql`
272
- fragment CommentsPageComment on Comment {
273
- id
274
- postedBy {
275
- login
276
- html_url
277
- }
278
- createdAt
279
- content
280
- }
281
- `;
282
- export const VoteButtonsFragmentDoc = gql`
283
- fragment VoteButtons on Entry {
284
- score
285
- vote {
286
- vote_value
287
- }
288
- }
289
- `;
290
- export const RepoInfoFragmentDoc = gql`
291
- fragment RepoInfo on Entry {
292
- createdAt
293
- repository {
294
- description
295
- stargazers_count
296
- open_issues_count
297
- }
298
- postedBy {
299
- html_url
300
- login
301
- }
302
- }
303
- `;
304
- export const FeedEntryFragmentDoc = gql`
305
- fragment FeedEntry on Entry {
306
- id
307
- commentCount
308
- repository {
309
- full_name
310
- html_url
311
- owner {
312
- avatar_url
313
- }
314
- }
315
- ...VoteButtons
316
- ...RepoInfo
317
- }
318
- ${VoteButtonsFragmentDoc}
319
- ${RepoInfoFragmentDoc}
320
- `;
321
- export const OnCommentAddedDocument = gql`
322
- subscription onCommentAdded($repoFullName: String!) {
323
- commentAdded(repoFullName: $repoFullName) {
324
- id
325
- postedBy {
326
- login
327
- html_url
328
- }
329
- createdAt
330
- content
331
- }
332
- }
333
- `;
334
-
335
- export function useOnCommentAddedSubscription<TData = OnCommentAddedSubscription>(
336
- options: Omit<Urql.UseSubscriptionArgs<OnCommentAddedSubscriptionVariables>, 'query'> = {},
337
- handler?: Urql.SubscriptionHandler<OnCommentAddedSubscription, TData>
338
- ) {
339
- return Urql.useSubscription<OnCommentAddedSubscription, TData, OnCommentAddedSubscriptionVariables>(
340
- { query: OnCommentAddedDocument, ...options },
341
- handler
342
- );
343
- }
344
- export const CommentDocument = gql`
345
- query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
346
- currentUser {
347
- login
348
- html_url
349
- }
350
- entry(repoFullName: $repoFullName) {
351
- id
352
- postedBy {
353
- login
354
- html_url
355
- }
356
- createdAt
357
- comments(limit: $limit, offset: $offset) {
358
- ...CommentsPageComment
359
- }
360
- commentCount
361
- repository {
362
- full_name
363
- html_url
364
- ... on Repository {
365
- description
366
- open_issues_count
367
- stargazers_count
368
- }
369
- }
370
- }
371
- }
372
- ${CommentsPageCommentFragmentDoc}
373
- `;
374
-
375
- export function useCommentQuery(options: Omit<Urql.UseQueryArgs<CommentQueryVariables>, 'query'> = {}) {
376
- return Urql.useQuery<CommentQuery>({ query: CommentDocument, ...options });
377
- }
378
- export const CurrentUserForProfileDocument = gql`
379
- query CurrentUserForProfile {
380
- currentUser {
381
- login
382
- avatar_url
383
- }
384
- }
385
- `;
386
-
387
- export function useCurrentUserForProfileQuery(
388
- options: Omit<Urql.UseQueryArgs<CurrentUserForProfileQueryVariables>, 'query'> = {}
389
- ) {
390
- return Urql.useQuery<CurrentUserForProfileQuery>({ query: CurrentUserForProfileDocument, ...options });
391
- }
392
- export const FeedDocument = gql`
393
- query Feed($type: FeedType!, $offset: Int, $limit: Int) {
394
- currentUser {
395
- login
396
- }
397
- feed(type: $type, offset: $offset, limit: $limit) {
398
- ...FeedEntry
399
- }
400
- }
401
- ${FeedEntryFragmentDoc}
402
- `;
403
-
404
- export function useFeedQuery(options: Omit<Urql.UseQueryArgs<FeedQueryVariables>, 'query'> = {}) {
405
- return Urql.useQuery<FeedQuery>({ query: FeedDocument, ...options });
406
- }
407
- export const SubmitRepositoryDocument = gql`
408
- mutation submitRepository($repoFullName: String!) {
409
- submitRepository(repoFullName: $repoFullName) {
410
- createdAt
411
- }
412
- }
413
- `;
414
-
415
- export function useSubmitRepositoryMutation() {
416
- return Urql.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(SubmitRepositoryDocument);
417
- }
418
- export const SubmitCommentDocument = gql`
419
- mutation submitComment($repoFullName: String!, $commentContent: String!) {
420
- submitComment(repoFullName: $repoFullName, commentContent: $commentContent) {
421
- ...CommentsPageComment
422
- }
423
- }
424
- ${CommentsPageCommentFragmentDoc}
425
- `;
426
-
427
- export function useSubmitCommentMutation() {
428
- return Urql.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument);
429
- }
430
- export const VoteDocument = gql`
431
- mutation vote($repoFullName: String!, $type: VoteType!) {
432
- vote(repoFullName: $repoFullName, type: $type) {
433
- score
434
- id
435
- vote {
436
- vote_value
437
- }
438
- }
439
- }
440
- `;
441
-
442
- export function useVoteMutation() {
443
- return Urql.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument);
444
- }