graphql-codegen-plugin-typescript-swr 0.8.5 → 0.9.0

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 (115) hide show
  1. package/README.md +5 -0
  2. package/build/main/visitor.js +2 -2
  3. package/build/module/visitor.js +2 -2
  4. package/package.json +8 -5
  5. package/.editorconfig +0 -13
  6. package/.eslintrc.js +0 -63
  7. package/.github/CONTRIBUTING.md +0 -3
  8. package/.github/ISSUE_TEMPLATE.md +0 -9
  9. package/.github/PULL_REQUEST_TEMPLATE.md +0 -7
  10. package/.github/workflows/main.yml +0 -28
  11. package/.gitignore +0 -8
  12. package/.prettierignore +0 -3
  13. package/.prettierrc.json +0 -4
  14. package/.vscode/extensions.json +0 -8
  15. package/.vscode/launch.json +0 -29
  16. package/.vscode/settings.json +0 -41
  17. package/build/tsconfig.main.tsbuildinfo +0 -1
  18. package/build/tsconfig.module.tsbuildinfo +0 -1
  19. package/dev-test/.env +0 -1
  20. package/dev-test/codegen.yml +0 -357
  21. package/dev-test/githunt/__generated__/comment-added.subscription.stencil-component.tsx +0 -47
  22. package/dev-test/githunt/__generated__/comment.query.stencil-component.tsx +0 -68
  23. package/dev-test/githunt/__generated__/comments-page-comment.fragment.stencil-component.tsx +0 -20
  24. package/dev-test/githunt/__generated__/current-user.query.stencil-component.tsx +0 -34
  25. package/dev-test/githunt/__generated__/feed-entry.fragment.stencil-component.tsx +0 -30
  26. package/dev-test/githunt/__generated__/feed.query.stencil-component.tsx +0 -40
  27. package/dev-test/githunt/__generated__/new-entry.mutation.stencil-component.tsx +0 -35
  28. package/dev-test/githunt/__generated__/repo-info.fragment.stencil-component.tsx +0 -26
  29. package/dev-test/githunt/__generated__/submit-comment.mutation.stencil-component.tsx +0 -35
  30. package/dev-test/githunt/__generated__/vote-buttons.fragment.stencil-component.tsx +0 -16
  31. package/dev-test/githunt/__generated__/vote.mutation.stencil-component.tsx +0 -41
  32. package/dev-test/githunt/comment-added.subscription.graphql +0 -11
  33. package/dev-test/githunt/comment.query.graphql +0 -33
  34. package/dev-test/githunt/comments-page-comment.fragment.graphql +0 -9
  35. package/dev-test/githunt/current-user.query.graphql +0 -6
  36. package/dev-test/githunt/feed-entry.fragment.graphql +0 -13
  37. package/dev-test/githunt/feed.query.graphql +0 -8
  38. package/dev-test/githunt/flow.flow.js +0 -367
  39. package/dev-test/githunt/graphql-declared-modules.d.ts +0 -87
  40. package/dev-test/githunt/new-entry.mutation.graphql +0 -5
  41. package/dev-test/githunt/repo-info.fragment.graphql +0 -12
  42. package/dev-test/githunt/schema.js +0 -3
  43. package/dev-test/githunt/schema.json +0 -1750
  44. package/dev-test/githunt/submit-comment.mutation.graphql +0 -5
  45. package/dev-test/githunt/typed-document-nodes.ts +0 -892
  46. package/dev-test/githunt/types.apolloAngular.sdk.ts +0 -570
  47. package/dev-test/githunt/types.apolloAngular.ts +0 -491
  48. package/dev-test/githunt/types.avoidOptionals.ts +0 -266
  49. package/dev-test/githunt/types.d.ts +0 -261
  50. package/dev-test/githunt/types.enumsAsTypes.ts +0 -261
  51. package/dev-test/githunt/types.flatten.preResolveTypes.ts +0 -289
  52. package/dev-test/githunt/types.immutableTypes.ts +0 -267
  53. package/dev-test/githunt/types.preResolveTypes.compatibility.ts +0 -368
  54. package/dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts +0 -156
  55. package/dev-test/githunt/types.preResolveTypes.ts +0 -293
  56. package/dev-test/githunt/types.reactApollo.customSuffix.tsx +0 -634
  57. package/dev-test/githunt/types.reactApollo.hooks.tsx +0 -621
  58. package/dev-test/githunt/types.reactApollo.preResolveTypes.tsx +0 -648
  59. package/dev-test/githunt/types.reactApollo.tsx +0 -621
  60. package/dev-test/githunt/types.reactApollo.v2.tsx +0 -635
  61. package/dev-test/githunt/types.stencilApollo.tsx +0 -484
  62. package/dev-test/githunt/types.ts +0 -266
  63. package/dev-test/githunt/types.urql.tsx +0 -444
  64. package/dev-test/githunt/types.vueApollo.ts +0 -647
  65. package/dev-test/githunt/vote-buttons.fragment.graphql +0 -6
  66. package/dev-test/githunt/vote.mutation.graphql +0 -9
  67. package/dev-test/setup.js +0 -3
  68. package/dev-test/test-message/documents.ts +0 -46
  69. package/dev-test/test-message/schema.graphql +0 -23
  70. package/dev-test/test-message/types.tsx +0 -237
  71. package/dev-test/test-schema/env.types.ts +0 -35
  72. package/dev-test/test-schema/flow-types.flow.js +0 -139
  73. package/dev-test/test-schema/local/schema-ast.js +0 -2
  74. package/dev-test/test-schema/local/schema-formats.js +0 -20
  75. package/dev-test/test-schema/local/schema-object.js +0 -2
  76. package/dev-test/test-schema/local/schema-text.js +0 -2
  77. package/dev-test/test-schema/local/schema.graphql +0 -8
  78. package/dev-test/test-schema/resolvers-federation.ts +0 -233
  79. package/dev-test/test-schema/resolvers-root.ts +0 -178
  80. package/dev-test/test-schema/resolvers-types.ts +0 -168
  81. package/dev-test/test-schema/schema-ast.js +0 -2
  82. package/dev-test/test-schema/schema-federation.graphql +0 -30
  83. package/dev-test/test-schema/schema-formats.js +0 -38
  84. package/dev-test/test-schema/schema-json.js +0 -2
  85. package/dev-test/test-schema/schema-object.js +0 -2
  86. package/dev-test/test-schema/schema-text.js +0 -2
  87. package/dev-test/test-schema/schema-with-imports.graphql +0 -9
  88. package/dev-test/test-schema/schema-with-root.graphql +0 -22
  89. package/dev-test/test-schema/schema.graphql +0 -19
  90. package/dev-test/test-schema/schema.json +0 -1070
  91. package/dev-test/test-schema/types.preResolveTypes.onlyOperationTypes.ts +0 -19
  92. package/dev-test/test-schema/types.preResolveTypes.ts +0 -44
  93. package/dev-test/test-schema/typings.avoidOptionals.ts +0 -27
  94. package/dev-test/test-schema/typings.enum.ts +0 -19
  95. package/dev-test/test-schema/typings.immutableTypes.ts +0 -27
  96. package/dev-test/test-schema/typings.ts +0 -156
  97. package/dev-test/test-schema/typings.wrapped.ts +0 -29
  98. package/dev-test/tsconfig.json +0 -18
  99. package/jest.config.js +0 -30
  100. package/renovate.json +0 -2
  101. package/src/config.ts +0 -29
  102. package/src/index.ts +0 -54
  103. package/src/visitor.ts +0 -259
  104. package/tests/outputs/autogenSWRKey.ts +0 -46
  105. package/tests/outputs/excludeQueries.ts +0 -13
  106. package/tests/outputs/infinite.ts +0 -49
  107. package/tests/outputs/mutations.ts +0 -19
  108. package/tests/outputs/rawRequest.ts +0 -19
  109. package/tests/outputs/straight.ts +0 -19
  110. package/tests/swr.spec.ts +0 -306
  111. package/tests/visitor.spec.ts +0 -19
  112. package/tsconfig.json +0 -32
  113. package/tsconfig.main.json +0 -11
  114. package/tsconfig.module.json +0 -13
  115. package/yarn.lock +0 -5359
@@ -1,648 +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 = {
173
- __typename?: 'Subscription';
174
- commentAdded?: Maybe<{
175
- __typename?: 'Comment';
176
- id: number;
177
- createdAt: number;
178
- content: string;
179
- postedBy: { __typename?: 'User'; login: string; html_url: string };
180
- }>;
181
- };
182
-
183
- export type CommentQueryVariables = Exact<{
184
- repoFullName: Scalars['String'];
185
- limit?: Maybe<Scalars['Int']>;
186
- offset?: Maybe<Scalars['Int']>;
187
- }>;
188
-
189
- export type CommentQuery = {
190
- __typename?: 'Query';
191
- currentUser?: Maybe<{ __typename?: 'User'; login: string; html_url: string }>;
192
- entry?: Maybe<{
193
- __typename?: 'Entry';
194
- id: number;
195
- createdAt: number;
196
- commentCount: number;
197
- postedBy: { __typename?: 'User'; login: string; html_url: string };
198
- comments: Array<Maybe<{ __typename?: 'Comment' } & CommentsPageCommentFragment>>;
199
- repository: {
200
- __typename?: 'Repository';
201
- description?: Maybe<string>;
202
- open_issues_count?: Maybe<number>;
203
- stargazers_count: number;
204
- full_name: string;
205
- html_url: string;
206
- };
207
- }>;
208
- };
209
-
210
- export type CommentsPageCommentFragment = {
211
- __typename?: 'Comment';
212
- id: number;
213
- createdAt: number;
214
- content: string;
215
- postedBy: { __typename?: 'User'; login: string; html_url: string };
216
- };
217
-
218
- export type CurrentUserForProfileQueryVariables = Exact<{ [key: string]: never }>;
219
-
220
- export type CurrentUserForProfileQuery = {
221
- __typename?: 'Query';
222
- currentUser?: Maybe<{ __typename?: 'User'; login: string; avatar_url: string }>;
223
- };
224
-
225
- export type FeedEntryFragment = {
226
- __typename?: 'Entry';
227
- id: number;
228
- commentCount: number;
229
- repository: {
230
- __typename?: 'Repository';
231
- full_name: string;
232
- html_url: string;
233
- owner?: Maybe<{ __typename?: 'User'; avatar_url: string }>;
234
- };
235
- } & VoteButtonsFragment &
236
- RepoInfoFragment;
237
-
238
- export type FeedQueryVariables = Exact<{
239
- type: FeedType;
240
- offset?: Maybe<Scalars['Int']>;
241
- limit?: Maybe<Scalars['Int']>;
242
- }>;
243
-
244
- export type FeedQuery = {
245
- __typename?: 'Query';
246
- currentUser?: Maybe<{ __typename?: 'User'; login: string }>;
247
- feed?: Maybe<Array<Maybe<{ __typename?: 'Entry' } & FeedEntryFragment>>>;
248
- };
249
-
250
- export type SubmitRepositoryMutationVariables = Exact<{
251
- repoFullName: Scalars['String'];
252
- }>;
253
-
254
- export type SubmitRepositoryMutation = {
255
- __typename?: 'Mutation';
256
- submitRepository?: Maybe<{ __typename?: 'Entry'; createdAt: number }>;
257
- };
258
-
259
- export type RepoInfoFragment = {
260
- __typename?: 'Entry';
261
- createdAt: number;
262
- repository: {
263
- __typename?: 'Repository';
264
- description?: Maybe<string>;
265
- stargazers_count: number;
266
- open_issues_count?: Maybe<number>;
267
- };
268
- postedBy: { __typename?: 'User'; html_url: string; login: string };
269
- };
270
-
271
- export type SubmitCommentMutationVariables = Exact<{
272
- repoFullName: Scalars['String'];
273
- commentContent: Scalars['String'];
274
- }>;
275
-
276
- export type SubmitCommentMutation = {
277
- __typename?: 'Mutation';
278
- submitComment?: Maybe<{ __typename?: 'Comment' } & CommentsPageCommentFragment>;
279
- };
280
-
281
- export type VoteButtonsFragment = {
282
- __typename?: 'Entry';
283
- score: number;
284
- vote: { __typename?: 'Vote'; vote_value: number };
285
- };
286
-
287
- export type VoteMutationVariables = Exact<{
288
- repoFullName: Scalars['String'];
289
- type: VoteType;
290
- }>;
291
-
292
- export type VoteMutation = {
293
- __typename?: 'Mutation';
294
- vote?: Maybe<{ __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } }>;
295
- };
296
-
297
- export const CommentsPageCommentFragmentDoc = gql`
298
- fragment CommentsPageComment on Comment {
299
- id
300
- postedBy {
301
- login
302
- html_url
303
- }
304
- createdAt
305
- content
306
- }
307
- `;
308
- export const VoteButtonsFragmentDoc = gql`
309
- fragment VoteButtons on Entry {
310
- score
311
- vote {
312
- vote_value
313
- }
314
- }
315
- `;
316
- export const RepoInfoFragmentDoc = gql`
317
- fragment RepoInfo on Entry {
318
- createdAt
319
- repository {
320
- description
321
- stargazers_count
322
- open_issues_count
323
- }
324
- postedBy {
325
- html_url
326
- login
327
- }
328
- }
329
- `;
330
- export const FeedEntryFragmentDoc = gql`
331
- fragment FeedEntry on Entry {
332
- id
333
- commentCount
334
- repository {
335
- full_name
336
- html_url
337
- owner {
338
- avatar_url
339
- }
340
- }
341
- ...VoteButtons
342
- ...RepoInfo
343
- }
344
- ${VoteButtonsFragmentDoc}
345
- ${RepoInfoFragmentDoc}
346
- `;
347
- export const OnCommentAddedDocument = gql`
348
- subscription onCommentAdded($repoFullName: String!) {
349
- commentAdded(repoFullName: $repoFullName) {
350
- id
351
- postedBy {
352
- login
353
- html_url
354
- }
355
- createdAt
356
- content
357
- }
358
- }
359
- `;
360
-
361
- /**
362
- * __useOnCommentAddedSubscription__
363
- *
364
- * To run a query within a React component, call `useOnCommentAddedSubscription` and pass it any options that fit your needs.
365
- * When your component renders, `useOnCommentAddedSubscription` returns an object from Apollo Client that contains loading, error, and data properties
366
- * you can use to render your UI.
367
- *
368
- * @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;
369
- *
370
- * @example
371
- * const { data, loading, error } = useOnCommentAddedSubscription({
372
- * variables: {
373
- * repoFullName: // value for 'repoFullName'
374
- * },
375
- * });
376
- */
377
- export function useOnCommentAddedSubscription(
378
- baseOptions?: Apollo.SubscriptionHookOptions<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>
379
- ) {
380
- return Apollo.useSubscription<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>(
381
- OnCommentAddedDocument,
382
- baseOptions
383
- );
384
- }
385
- export type OnCommentAddedSubscriptionHookResult = ReturnType<typeof useOnCommentAddedSubscription>;
386
- export type OnCommentAddedSubscriptionResult = Apollo.SubscriptionResult<OnCommentAddedSubscription>;
387
- export const CommentDocument = gql`
388
- query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
389
- currentUser {
390
- login
391
- html_url
392
- }
393
- entry(repoFullName: $repoFullName) {
394
- id
395
- postedBy {
396
- login
397
- html_url
398
- }
399
- createdAt
400
- comments(limit: $limit, offset: $offset) {
401
- ...CommentsPageComment
402
- }
403
- commentCount
404
- repository {
405
- full_name
406
- html_url
407
- ... on Repository {
408
- description
409
- open_issues_count
410
- stargazers_count
411
- }
412
- }
413
- }
414
- }
415
- ${CommentsPageCommentFragmentDoc}
416
- `;
417
-
418
- /**
419
- * __useCommentQuery__
420
- *
421
- * To run a query within a React component, call `useCommentQuery` and pass it any options that fit your needs.
422
- * When your component renders, `useCommentQuery` returns an object from Apollo Client that contains loading, error, and data properties
423
- * you can use to render your UI.
424
- *
425
- * @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;
426
- *
427
- * @example
428
- * const { data, loading, error } = useCommentQuery({
429
- * variables: {
430
- * repoFullName: // value for 'repoFullName'
431
- * limit: // value for 'limit'
432
- * offset: // value for 'offset'
433
- * },
434
- * });
435
- */
436
- export function useCommentQuery(baseOptions?: Apollo.QueryHookOptions<CommentQuery, CommentQueryVariables>) {
437
- return Apollo.useQuery<CommentQuery, CommentQueryVariables>(CommentDocument, baseOptions);
438
- }
439
- export function useCommentLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CommentQuery, CommentQueryVariables>) {
440
- return Apollo.useLazyQuery<CommentQuery, CommentQueryVariables>(CommentDocument, baseOptions);
441
- }
442
- export type CommentQueryHookResult = ReturnType<typeof useCommentQuery>;
443
- export type CommentLazyQueryHookResult = ReturnType<typeof useCommentLazyQuery>;
444
- export type CommentQueryResult = Apollo.QueryResult<CommentQuery, CommentQueryVariables>;
445
- export const CurrentUserForProfileDocument = gql`
446
- query CurrentUserForProfile {
447
- currentUser {
448
- login
449
- avatar_url
450
- }
451
- }
452
- `;
453
-
454
- /**
455
- * __useCurrentUserForProfileQuery__
456
- *
457
- * To run a query within a React component, call `useCurrentUserForProfileQuery` and pass it any options that fit your needs.
458
- * When your component renders, `useCurrentUserForProfileQuery` returns an object from Apollo Client that contains loading, error, and data properties
459
- * you can use to render your UI.
460
- *
461
- * @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;
462
- *
463
- * @example
464
- * const { data, loading, error } = useCurrentUserForProfileQuery({
465
- * variables: {
466
- * },
467
- * });
468
- */
469
- export function useCurrentUserForProfileQuery(
470
- baseOptions?: Apollo.QueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
471
- ) {
472
- return Apollo.useQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
473
- CurrentUserForProfileDocument,
474
- baseOptions
475
- );
476
- }
477
- export function useCurrentUserForProfileLazyQuery(
478
- baseOptions?: Apollo.LazyQueryHookOptions<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>
479
- ) {
480
- return Apollo.useLazyQuery<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
481
- CurrentUserForProfileDocument,
482
- baseOptions
483
- );
484
- }
485
- export type CurrentUserForProfileQueryHookResult = ReturnType<typeof useCurrentUserForProfileQuery>;
486
- export type CurrentUserForProfileLazyQueryHookResult = ReturnType<typeof useCurrentUserForProfileLazyQuery>;
487
- export type CurrentUserForProfileQueryResult = Apollo.QueryResult<
488
- CurrentUserForProfileQuery,
489
- CurrentUserForProfileQueryVariables
490
- >;
491
- export const FeedDocument = gql`
492
- query Feed($type: FeedType!, $offset: Int, $limit: Int) {
493
- currentUser {
494
- login
495
- }
496
- feed(type: $type, offset: $offset, limit: $limit) {
497
- ...FeedEntry
498
- }
499
- }
500
- ${FeedEntryFragmentDoc}
501
- `;
502
-
503
- /**
504
- * __useFeedQuery__
505
- *
506
- * To run a query within a React component, call `useFeedQuery` and pass it any options that fit your needs.
507
- * When your component renders, `useFeedQuery` returns an object from Apollo Client that contains loading, error, and data properties
508
- * you can use to render your UI.
509
- *
510
- * @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;
511
- *
512
- * @example
513
- * const { data, loading, error } = useFeedQuery({
514
- * variables: {
515
- * type: // value for 'type'
516
- * offset: // value for 'offset'
517
- * limit: // value for 'limit'
518
- * },
519
- * });
520
- */
521
- export function useFeedQuery(baseOptions?: Apollo.QueryHookOptions<FeedQuery, FeedQueryVariables>) {
522
- return Apollo.useQuery<FeedQuery, FeedQueryVariables>(FeedDocument, baseOptions);
523
- }
524
- export function useFeedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>) {
525
- return Apollo.useLazyQuery<FeedQuery, FeedQueryVariables>(FeedDocument, baseOptions);
526
- }
527
- export type FeedQueryHookResult = ReturnType<typeof useFeedQuery>;
528
- export type FeedLazyQueryHookResult = ReturnType<typeof useFeedLazyQuery>;
529
- export type FeedQueryResult = Apollo.QueryResult<FeedQuery, FeedQueryVariables>;
530
- export const SubmitRepositoryDocument = gql`
531
- mutation submitRepository($repoFullName: String!) {
532
- submitRepository(repoFullName: $repoFullName) {
533
- createdAt
534
- }
535
- }
536
- `;
537
- export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
538
- SubmitRepositoryMutation,
539
- SubmitRepositoryMutationVariables
540
- >;
541
-
542
- /**
543
- * __useSubmitRepositoryMutation__
544
- *
545
- * To run a mutation, you first call `useSubmitRepositoryMutation` within a React component and pass it any options that fit your needs.
546
- * When your component renders, `useSubmitRepositoryMutation` returns a tuple that includes:
547
- * - A mutate function that you can call at any time to execute the mutation
548
- * - An object with fields that represent the current status of the mutation's execution
549
- *
550
- * @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;
551
- *
552
- * @example
553
- * const [submitRepositoryMutation, { data, loading, error }] = useSubmitRepositoryMutation({
554
- * variables: {
555
- * repoFullName: // value for 'repoFullName'
556
- * },
557
- * });
558
- */
559
- export function useSubmitRepositoryMutation(
560
- baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>
561
- ) {
562
- return Apollo.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
563
- SubmitRepositoryDocument,
564
- baseOptions
565
- );
566
- }
567
- export type SubmitRepositoryMutationHookResult = ReturnType<typeof useSubmitRepositoryMutation>;
568
- export type SubmitRepositoryMutationResult = Apollo.MutationResult<SubmitRepositoryMutation>;
569
- export type SubmitRepositoryMutationOptions = Apollo.BaseMutationOptions<
570
- SubmitRepositoryMutation,
571
- SubmitRepositoryMutationVariables
572
- >;
573
- export const SubmitCommentDocument = gql`
574
- mutation submitComment($repoFullName: String!, $commentContent: String!) {
575
- submitComment(repoFullName: $repoFullName, commentContent: $commentContent) {
576
- ...CommentsPageComment
577
- }
578
- }
579
- ${CommentsPageCommentFragmentDoc}
580
- `;
581
- export type SubmitCommentMutationFn = Apollo.MutationFunction<SubmitCommentMutation, SubmitCommentMutationVariables>;
582
-
583
- /**
584
- * __useSubmitCommentMutation__
585
- *
586
- * To run a mutation, you first call `useSubmitCommentMutation` within a React component and pass it any options that fit your needs.
587
- * When your component renders, `useSubmitCommentMutation` returns a tuple that includes:
588
- * - A mutate function that you can call at any time to execute the mutation
589
- * - An object with fields that represent the current status of the mutation's execution
590
- *
591
- * @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;
592
- *
593
- * @example
594
- * const [submitCommentMutation, { data, loading, error }] = useSubmitCommentMutation({
595
- * variables: {
596
- * repoFullName: // value for 'repoFullName'
597
- * commentContent: // value for 'commentContent'
598
- * },
599
- * });
600
- */
601
- export function useSubmitCommentMutation(
602
- baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutation, SubmitCommentMutationVariables>
603
- ) {
604
- return Apollo.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument, baseOptions);
605
- }
606
- export type SubmitCommentMutationHookResult = ReturnType<typeof useSubmitCommentMutation>;
607
- export type SubmitCommentMutationResult = Apollo.MutationResult<SubmitCommentMutation>;
608
- export type SubmitCommentMutationOptions = Apollo.BaseMutationOptions<
609
- SubmitCommentMutation,
610
- SubmitCommentMutationVariables
611
- >;
612
- export const VoteDocument = gql`
613
- mutation vote($repoFullName: String!, $type: VoteType!) {
614
- vote(repoFullName: $repoFullName, type: $type) {
615
- score
616
- id
617
- vote {
618
- vote_value
619
- }
620
- }
621
- }
622
- `;
623
- export type VoteMutationFn = Apollo.MutationFunction<VoteMutation, VoteMutationVariables>;
624
-
625
- /**
626
- * __useVoteMutation__
627
- *
628
- * To run a mutation, you first call `useVoteMutation` within a React component and pass it any options that fit your needs.
629
- * When your component renders, `useVoteMutation` returns a tuple that includes:
630
- * - A mutate function that you can call at any time to execute the mutation
631
- * - An object with fields that represent the current status of the mutation's execution
632
- *
633
- * @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;
634
- *
635
- * @example
636
- * const [voteMutation, { data, loading, error }] = useVoteMutation({
637
- * variables: {
638
- * repoFullName: // value for 'repoFullName'
639
- * type: // value for 'type'
640
- * },
641
- * });
642
- */
643
- export function useVoteMutation(baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
644
- return Apollo.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, baseOptions);
645
- }
646
- export type VoteMutationHookResult = ReturnType<typeof useVoteMutation>;
647
- export type VoteMutationResult = Apollo.MutationResult<VoteMutation>;
648
- export type VoteMutationOptions = Apollo.BaseMutationOptions<VoteMutation, VoteMutationVariables>;