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,621 +0,0 @@
1
- import { gql } from '@apollo/client';
2
- import * as Apollo from '@apollo/client';
3
- export type Maybe<T> = T | null;
4
- export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
5
- /** All built-in and custom scalars, mapped to their actual values */
6
- export type Scalars = {
7
- ID: string;
8
- String: string;
9
- Boolean: boolean;
10
- Int: number;
11
- Float: number;
12
- };
13
-
14
- export type Query = {
15
- __typename?: 'Query';
16
- /** A feed of repository submissions */
17
- feed?: Maybe<Array<Maybe<Entry>>>;
18
- /** A single entry */
19
- entry?: Maybe<Entry>;
20
- /** Return the currently logged in user, or null if nobody is logged in */
21
- currentUser?: Maybe<User>;
22
- };
23
-
24
- export type QueryFeedArgs = {
25
- type: FeedType;
26
- offset?: Maybe<Scalars['Int']>;
27
- limit?: Maybe<Scalars['Int']>;
28
- };
29
-
30
- export type QueryEntryArgs = {
31
- repoFullName: Scalars['String'];
32
- };
33
-
34
- /** A list of options for the sort order of the feed */
35
- export enum FeedType {
36
- /** Sort by a combination of freshness and score, using Reddit's algorithm */
37
- Hot = 'HOT',
38
- /** Newest entries first */
39
- New = 'NEW',
40
- /** Highest score entries first */
41
- Top = 'TOP',
42
- }
43
-
44
- /** Information about a GitHub repository submitted to GitHunt */
45
- export type Entry = {
46
- __typename?: 'Entry';
47
- /** Information about the repository from GitHub */
48
- repository: Repository;
49
- /** The GitHub user who submitted this entry */
50
- postedBy: User;
51
- /** A timestamp of when the entry was submitted */
52
- createdAt: Scalars['Float'];
53
- /** The score of this repository, upvotes - downvotes */
54
- score: Scalars['Int'];
55
- /** The hot score of this repository */
56
- hotScore: Scalars['Float'];
57
- /** Comments posted about this repository */
58
- comments: Array<Maybe<Comment>>;
59
- /** The number of comments posted about this repository */
60
- commentCount: Scalars['Int'];
61
- /** The SQL ID of this entry */
62
- id: Scalars['Int'];
63
- /** XXX to be changed */
64
- vote: Vote;
65
- };
66
-
67
- /** Information about a GitHub repository submitted to GitHunt */
68
- export type EntryCommentsArgs = {
69
- limit?: Maybe<Scalars['Int']>;
70
- offset?: Maybe<Scalars['Int']>;
71
- };
72
-
73
- /**
74
- * A repository object from the GitHub API. This uses the exact field names returned by the
75
- * GitHub API for simplicity, even though the convention for GraphQL is usually to camel case.
76
- */
77
- export type Repository = {
78
- __typename?: 'Repository';
79
- /** Just the name of the repository, e.g. GitHunt-API */
80
- name: Scalars['String'];
81
- /** The full name of the repository with the username, e.g. apollostack/GitHunt-API */
82
- full_name: Scalars['String'];
83
- /** The description of the repository */
84
- description?: Maybe<Scalars['String']>;
85
- /** The link to the repository on GitHub */
86
- html_url: Scalars['String'];
87
- /** The number of people who have starred this repository on GitHub */
88
- stargazers_count: Scalars['Int'];
89
- /** The number of open issues on this repository on GitHub */
90
- open_issues_count?: Maybe<Scalars['Int']>;
91
- /** The owner of this repository on GitHub, e.g. apollostack */
92
- owner?: Maybe<User>;
93
- };
94
-
95
- /** A user object from the GitHub API. This uses the exact field names returned from the GitHub API. */
96
- export type User = {
97
- __typename?: 'User';
98
- /** The name of the user, e.g. apollostack */
99
- login: Scalars['String'];
100
- /** The URL to a directly embeddable image for this user's avatar */
101
- avatar_url: Scalars['String'];
102
- /** The URL of this user's GitHub page */
103
- html_url: Scalars['String'];
104
- };
105
-
106
- /** A comment about an entry, submitted by a user */
107
- export type Comment = {
108
- __typename?: 'Comment';
109
- /** The SQL ID of this entry */
110
- id: Scalars['Int'];
111
- /** The GitHub user who posted the comment */
112
- postedBy: User;
113
- /** A timestamp of when the comment was posted */
114
- createdAt: Scalars['Float'];
115
- /** The text of the comment */
116
- content: Scalars['String'];
117
- /** The repository which this comment is about */
118
- repoName: Scalars['String'];
119
- };
120
-
121
- /** XXX to be removed */
122
- export type Vote = {
123
- __typename?: 'Vote';
124
- vote_value: Scalars['Int'];
125
- };
126
-
127
- export type Mutation = {
128
- __typename?: 'Mutation';
129
- /** Submit a new repository, returns the new submission */
130
- submitRepository?: Maybe<Entry>;
131
- /** Vote on a repository submission, returns the submission that was voted on */
132
- vote?: Maybe<Entry>;
133
- /** Comment on a repository, returns the new comment */
134
- submitComment?: Maybe<Comment>;
135
- };
136
-
137
- export type MutationSubmitRepositoryArgs = {
138
- repoFullName: Scalars['String'];
139
- };
140
-
141
- export type MutationVoteArgs = {
142
- repoFullName: Scalars['String'];
143
- type: VoteType;
144
- };
145
-
146
- export type MutationSubmitCommentArgs = {
147
- repoFullName: Scalars['String'];
148
- commentContent: Scalars['String'];
149
- };
150
-
151
- /** The type of vote to record, when submitting a vote */
152
- export enum VoteType {
153
- Up = 'UP',
154
- Down = 'DOWN',
155
- Cancel = 'CANCEL',
156
- }
157
-
158
- export type Subscription = {
159
- __typename?: 'Subscription';
160
- /** Subscription fires on every comment added */
161
- commentAdded?: Maybe<Comment>;
162
- };
163
-
164
- export type SubscriptionCommentAddedArgs = {
165
- repoFullName: Scalars['String'];
166
- };
167
-
168
- export type OnCommentAddedSubscriptionVariables = Exact<{
169
- repoFullName: Scalars['String'];
170
- }>;
171
-
172
- export type OnCommentAddedSubscription = { __typename?: 'Subscription' } & {
173
- commentAdded?: Maybe<
174
- { __typename?: 'Comment' } & Pick<Comment, 'id' | 'createdAt' | 'content'> & {
175
- postedBy: { __typename?: 'User' } & Pick<User, 'login' | 'html_url'>;
176
- }
177
- >;
178
- };
179
-
180
- export type CommentQueryVariables = Exact<{
181
- repoFullName: Scalars['String'];
182
- limit?: Maybe<Scalars['Int']>;
183
- offset?: Maybe<Scalars['Int']>;
184
- }>;
185
-
186
- export type CommentQuery = { __typename?: 'Query' } & {
187
- currentUser?: Maybe<{ __typename?: 'User' } & Pick<User, 'login' | 'html_url'>>;
188
- entry?: Maybe<
189
- { __typename?: 'Entry' } & Pick<Entry, 'id' | 'createdAt' | 'commentCount'> & {
190
- postedBy: { __typename?: 'User' } & Pick<User, 'login' | 'html_url'>;
191
- comments: Array<Maybe<{ __typename?: 'Comment' } & CommentsPageCommentFragment>>;
192
- repository: { __typename?: 'Repository' } & Pick<
193
- Repository,
194
- 'description' | 'open_issues_count' | 'stargazers_count' | 'full_name' | 'html_url'
195
- >;
196
- }
197
- >;
198
- };
199
-
200
- export type CommentsPageCommentFragment = { __typename?: 'Comment' } & Pick<Comment, 'id' | 'createdAt' | 'content'> & {
201
- postedBy: { __typename?: 'User' } & Pick<User, 'login' | 'html_url'>;
202
- };
203
-
204
- export type CurrentUserForProfileQueryVariables = Exact<{ [key: string]: never }>;
205
-
206
- export type CurrentUserForProfileQuery = { __typename?: 'Query' } & {
207
- currentUser?: Maybe<{ __typename?: 'User' } & Pick<User, 'login' | 'avatar_url'>>;
208
- };
209
-
210
- export type FeedEntryFragment = { __typename?: 'Entry' } & Pick<Entry, 'id' | 'commentCount'> & {
211
- repository: { __typename?: 'Repository' } & Pick<Repository, 'full_name' | 'html_url'> & {
212
- owner?: Maybe<{ __typename?: 'User' } & Pick<User, 'avatar_url'>>;
213
- };
214
- } & VoteButtonsFragment &
215
- RepoInfoFragment;
216
-
217
- export type FeedQueryVariables = Exact<{
218
- type: FeedType;
219
- offset?: Maybe<Scalars['Int']>;
220
- limit?: Maybe<Scalars['Int']>;
221
- }>;
222
-
223
- export type FeedQuery = { __typename?: 'Query' } & {
224
- currentUser?: Maybe<{ __typename?: 'User' } & Pick<User, 'login'>>;
225
- feed?: Maybe<Array<Maybe<{ __typename?: 'Entry' } & FeedEntryFragment>>>;
226
- };
227
-
228
- export type SubmitRepositoryMutationVariables = Exact<{
229
- repoFullName: Scalars['String'];
230
- }>;
231
-
232
- export type SubmitRepositoryMutation = { __typename?: 'Mutation' } & {
233
- submitRepository?: Maybe<{ __typename?: 'Entry' } & Pick<Entry, 'createdAt'>>;
234
- };
235
-
236
- export type RepoInfoFragment = { __typename?: 'Entry' } & Pick<Entry, 'createdAt'> & {
237
- repository: { __typename?: 'Repository' } & Pick<
238
- Repository,
239
- 'description' | 'stargazers_count' | 'open_issues_count'
240
- >;
241
- postedBy: { __typename?: 'User' } & Pick<User, 'html_url' | 'login'>;
242
- };
243
-
244
- export type SubmitCommentMutationVariables = Exact<{
245
- repoFullName: Scalars['String'];
246
- commentContent: Scalars['String'];
247
- }>;
248
-
249
- export type SubmitCommentMutation = { __typename?: 'Mutation' } & {
250
- submitComment?: Maybe<{ __typename?: 'Comment' } & CommentsPageCommentFragment>;
251
- };
252
-
253
- export type VoteButtonsFragment = { __typename?: 'Entry' } & Pick<Entry, 'score'> & {
254
- vote: { __typename?: 'Vote' } & Pick<Vote, 'vote_value'>;
255
- };
256
-
257
- export type VoteMutationVariables = Exact<{
258
- repoFullName: Scalars['String'];
259
- type: VoteType;
260
- }>;
261
-
262
- export type VoteMutation = { __typename?: 'Mutation' } & {
263
- vote?: Maybe<
264
- { __typename?: 'Entry' } & Pick<Entry, 'score' | 'id'> & {
265
- vote: { __typename?: 'Vote' } & Pick<Vote, 'vote_value'>;
266
- }
267
- >;
268
- };
269
-
270
- export const CommentsPageCommentFragmentDoc = gql`
271
- fragment CommentsPageComment on Comment {
272
- id
273
- postedBy {
274
- login
275
- html_url
276
- }
277
- createdAt
278
- content
279
- }
280
- `;
281
- export const VoteButtonsFragmentDoc = gql`
282
- fragment VoteButtons on Entry {
283
- score
284
- vote {
285
- vote_value
286
- }
287
- }
288
- `;
289
- export const RepoInfoFragmentDoc = gql`
290
- fragment RepoInfo on Entry {
291
- createdAt
292
- repository {
293
- description
294
- stargazers_count
295
- open_issues_count
296
- }
297
- postedBy {
298
- html_url
299
- login
300
- }
301
- }
302
- `;
303
- export const FeedEntryFragmentDoc = gql`
304
- fragment FeedEntry on Entry {
305
- id
306
- commentCount
307
- repository {
308
- full_name
309
- html_url
310
- owner {
311
- avatar_url
312
- }
313
- }
314
- ...VoteButtons
315
- ...RepoInfo
316
- }
317
- ${VoteButtonsFragmentDoc}
318
- ${RepoInfoFragmentDoc}
319
- `;
320
- export const OnCommentAddedDocument = gql`
321
- subscription onCommentAdded($repoFullName: String!) {
322
- commentAdded(repoFullName: $repoFullName) {
323
- id
324
- postedBy {
325
- login
326
- html_url
327
- }
328
- createdAt
329
- content
330
- }
331
- }
332
- `;
333
-
334
- /**
335
- * __useOnCommentAddedSubscription__
336
- *
337
- * To run a query within a React component, call `useOnCommentAddedSubscription` and pass it any options that fit your needs.
338
- * When your component renders, `useOnCommentAddedSubscription` returns an object from Apollo Client that contains loading, error, and data properties
339
- * you can use to render your UI.
340
- *
341
- * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
342
- *
343
- * @example
344
- * const { data, loading, error } = useOnCommentAddedSubscription({
345
- * variables: {
346
- * repoFullName: // value for 'repoFullName'
347
- * },
348
- * });
349
- */
350
- export function useOnCommentAddedSubscription(
351
- baseOptions?: Apollo.SubscriptionHookOptions<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>
352
- ) {
353
- return Apollo.useSubscription<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>(
354
- OnCommentAddedDocument,
355
- baseOptions
356
- );
357
- }
358
- export type OnCommentAddedSubscriptionHookResult = ReturnType<typeof useOnCommentAddedSubscription>;
359
- export type OnCommentAddedSubscriptionResult = Apollo.SubscriptionResult<OnCommentAddedSubscription>;
360
- export const CommentDocument = gql`
361
- query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
362
- currentUser {
363
- login
364
- html_url
365
- }
366
- entry(repoFullName: $repoFullName) {
367
- id
368
- postedBy {
369
- login
370
- html_url
371
- }
372
- createdAt
373
- comments(limit: $limit, offset: $offset) {
374
- ...CommentsPageComment
375
- }
376
- commentCount
377
- repository {
378
- full_name
379
- html_url
380
- ... on Repository {
381
- description
382
- open_issues_count
383
- stargazers_count
384
- }
385
- }
386
- }
387
- }
388
- ${CommentsPageCommentFragmentDoc}
389
- `;
390
-
391
- /**
392
- * __useCommentQuery__
393
- *
394
- * To run a query within a React component, call `useCommentQuery` and pass it any options that fit your needs.
395
- * When your component renders, `useCommentQuery` returns an object from Apollo Client that contains loading, error, and data properties
396
- * you can use to render your UI.
397
- *
398
- * @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;
399
- *
400
- * @example
401
- * const { data, loading, error } = useCommentQuery({
402
- * variables: {
403
- * repoFullName: // value for 'repoFullName'
404
- * limit: // value for 'limit'
405
- * offset: // value for 'offset'
406
- * },
407
- * });
408
- */
409
- export function useCommentQuery(baseOptions?: Apollo.QueryHookOptions<CommentQuery, CommentQueryVariables>) {
410
- return Apollo.useQuery<CommentQuery, CommentQueryVariables>(CommentDocument, baseOptions);
411
- }
412
- export function useCommentLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CommentQuery, CommentQueryVariables>) {
413
- return Apollo.useLazyQuery<CommentQuery, CommentQueryVariables>(CommentDocument, baseOptions);
414
- }
415
- export type CommentQueryHookResult = ReturnType<typeof useCommentQuery>;
416
- export type CommentLazyQueryHookResult = ReturnType<typeof useCommentLazyQuery>;
417
- export type CommentQueryResult = Apollo.QueryResult<CommentQuery, CommentQueryVariables>;
418
- export const CurrentUserForProfileDocument = gql`
419
- query CurrentUserForProfile {
420
- currentUser {
421
- login
422
- avatar_url
423
- }
424
- }
425
- `;
426
-
427
- /**
428
- * __useCurrentUserForProfileQuery__
429
- *
430
- * To run a query within a React component, call `useCurrentUserForProfileQuery` and pass it any options that fit your needs.
431
- * When your component renders, `useCurrentUserForProfileQuery` returns an object from Apollo Client that contains loading, error, and data properties
432
- * you can use to render your UI.
433
- *
434
- * @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;
435
- *
436
- * @example
437
- * const { data, loading, error } = useCurrentUserForProfileQuery({
438
- * variables: {
439
- * },
440
- * });
441
- */
442
- export function useCurrentUserForProfileQuery(
443
- baseOptions?: Apollo.QueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
444
- ) {
445
- return Apollo.useQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
446
- CurrentUserForProfileDocument,
447
- baseOptions
448
- );
449
- }
450
- export function useCurrentUserForProfileLazyQuery(
451
- baseOptions?: Apollo.LazyQueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
452
- ) {
453
- return Apollo.useLazyQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
454
- CurrentUserForProfileDocument,
455
- baseOptions
456
- );
457
- }
458
- export type CurrentUserForProfileQueryHookResult = ReturnType<typeof useCurrentUserForProfileQuery>;
459
- export type CurrentUserForProfileLazyQueryHookResult = ReturnType<typeof useCurrentUserForProfileLazyQuery>;
460
- export type CurrentUserForProfileQueryResult = Apollo.QueryResult<
461
- CurrentUserForProfileQuery,
462
- CurrentUserForProfileQueryVariables
463
- >;
464
- export const FeedDocument = gql`
465
- query Feed($type: FeedType!, $offset: Int, $limit: Int) {
466
- currentUser {
467
- login
468
- }
469
- feed(type: $type, offset: $offset, limit: $limit) {
470
- ...FeedEntry
471
- }
472
- }
473
- ${FeedEntryFragmentDoc}
474
- `;
475
-
476
- /**
477
- * __useFeedQuery__
478
- *
479
- * To run a query within a React component, call `useFeedQuery` and pass it any options that fit your needs.
480
- * When your component renders, `useFeedQuery` returns an object from Apollo Client that contains loading, error, and data properties
481
- * you can use to render your UI.
482
- *
483
- * @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;
484
- *
485
- * @example
486
- * const { data, loading, error } = useFeedQuery({
487
- * variables: {
488
- * type: // value for 'type'
489
- * offset: // value for 'offset'
490
- * limit: // value for 'limit'
491
- * },
492
- * });
493
- */
494
- export function useFeedQuery(baseOptions?: Apollo.QueryHookOptions<FeedQuery, FeedQueryVariables>) {
495
- return Apollo.useQuery<FeedQuery, FeedQueryVariables>(FeedDocument, baseOptions);
496
- }
497
- export function useFeedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>) {
498
- return Apollo.useLazyQuery<FeedQuery, FeedQueryVariables>(FeedDocument, baseOptions);
499
- }
500
- export type FeedQueryHookResult = ReturnType<typeof useFeedQuery>;
501
- export type FeedLazyQueryHookResult = ReturnType<typeof useFeedLazyQuery>;
502
- export type FeedQueryResult = Apollo.QueryResult<FeedQuery, FeedQueryVariables>;
503
- export const SubmitRepositoryDocument = gql`
504
- mutation submitRepository($repoFullName: String!) {
505
- submitRepository(repoFullName: $repoFullName) {
506
- createdAt
507
- }
508
- }
509
- `;
510
- export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
511
- SubmitRepositoryMutation,
512
- SubmitRepositoryMutationVariables
513
- >;
514
-
515
- /**
516
- * __useSubmitRepositoryMutation__
517
- *
518
- * To run a mutation, you first call `useSubmitRepositoryMutation` within a React component and pass it any options that fit your needs.
519
- * When your component renders, `useSubmitRepositoryMutation` returns a tuple that includes:
520
- * - A mutate function that you can call at any time to execute the mutation
521
- * - An object with fields that represent the current status of the mutation's execution
522
- *
523
- * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
524
- *
525
- * @example
526
- * const [submitRepositoryMutation, { data, loading, error }] = useSubmitRepositoryMutation({
527
- * variables: {
528
- * repoFullName: // value for 'repoFullName'
529
- * },
530
- * });
531
- */
532
- export function useSubmitRepositoryMutation(
533
- baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
534
- ) {
535
- return Apollo.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
536
- SubmitRepositoryDocument,
537
- baseOptions
538
- );
539
- }
540
- export type SubmitRepositoryMutationHookResult = ReturnType<typeof useSubmitRepositoryMutation>;
541
- export type SubmitRepositoryMutationResult = Apollo.MutationResult<SubmitRepositoryMutation>;
542
- export type SubmitRepositoryMutationOptions = Apollo.BaseMutationOptions<
543
- SubmitRepositoryMutation,
544
- SubmitRepositoryMutationVariables
545
- >;
546
- export const SubmitCommentDocument = gql`
547
- mutation submitComment($repoFullName: String!, $commentContent: String!) {
548
- submitComment(repoFullName: $repoFullName, commentContent: $commentContent) {
549
- ...CommentsPageComment
550
- }
551
- }
552
- ${CommentsPageCommentFragmentDoc}
553
- `;
554
- export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutation, SubmitCommentMutationVariables>;
555
-
556
- /**
557
- * __useSubmitCommentMutation__
558
- *
559
- * To run a mutation, you first call `useSubmitCommentMutation` within a React component and pass it any options that fit your needs.
560
- * When your component renders, `useSubmitCommentMutation` returns a tuple that includes:
561
- * - A mutate function that you can call at any time to execute the mutation
562
- * - An object with fields that represent the current status of the mutation's execution
563
- *
564
- * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
565
- *
566
- * @example
567
- * const [submitCommentMutation, { data, loading, error }] = useSubmitCommentMutation({
568
- * variables: {
569
- * repoFullName: // value for 'repoFullName'
570
- * commentContent: // value for 'commentContent'
571
- * },
572
- * });
573
- */
574
- export function useSubmitCommentMutation(
575
- baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
576
- ) {
577
- return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument, baseOptions);
578
- }
579
- export type SubmitCommentMutationHookResult = ReturnType<typeof useSubmitCommentMutation>;
580
- export type SubmitCommentMutationResult = Apollo.MutationResult<SubmitCommentMutation>;
581
- export type SubmitCommentMutationOptions = Apollo.BaseMutationOptions<
582
- SubmitCommentMutation,
583
- SubmitCommentMutationVariables
584
- >;
585
- export const VoteDocument = gql`
586
- mutation vote($repoFullName: String!, $type: VoteType!) {
587
- vote(repoFullName: $repoFullName, type: $type) {
588
- score
589
- id
590
- vote {
591
- vote_value
592
- }
593
- }
594
- }
595
- `;
596
- export type VoteMutationFn = Apollo.MutationFunction<VoteMutation, VoteMutationVariables>;
597
-
598
- /**
599
- * __useVoteMutation__
600
- *
601
- * To run a mutation, you first call `useVoteMutation` within a React component and pass it any options that fit your needs.
602
- * When your component renders, `useVoteMutation` returns a tuple that includes:
603
- * - A mutate function that you can call at any time to execute the mutation
604
- * - An object with fields that represent the current status of the mutation's execution
605
- *
606
- * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
607
- *
608
- * @example
609
- * const [voteMutation, { data, loading, error }] = useVoteMutation({
610
- * variables: {
611
- * repoFullName: // value for 'repoFullName'
612
- * type: // value for 'type'
613
- * },
614
- * });
615
- */
616
- export function useVoteMutation(baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
617
- return Apollo.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, baseOptions);
618
- }
619
- export type VoteMutationHookResult = ReturnType<typeof useVoteMutation>;
620
- export type VoteMutationResult = Apollo.MutationResult<VoteMutation>;
621
- export type VoteMutationOptions = Apollo.BaseMutationOptions<VoteMutation, VoteMutationVariables>;