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,634 +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 OnCommentAddedSubscriptionMyOperation = { __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 CommentQueryMyOperation = { __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 CurrentUserForProfileQueryMyOperation = { __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 FeedQueryMyOperation = { __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 SubmitRepositoryMutationMyOperation = { __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 SubmitCommentMutationMyOperation = { __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 VoteMutationMyOperation = { __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<
352
- OnCommentAddedSubscriptionMyOperation,
353
- OnCommentAddedSubscriptionVariables
354
- >
355
- ) {
356
- return Apollo.useSubscription<OnCommentAddedSubscriptionMyOperation, OnCommentAddedSubscriptionVariables>(
357
- OnCommentAddedDocument,
358
- baseOptions
359
- );
360
- }
361
- export type OnCommentAddedSubscriptionHookResult = ReturnType<typeof useOnCommentAddedSubscription>;
362
- export type OnCommentAddedSubscriptionResult = Apollo.SubscriptionResult<OnCommentAddedSubscriptionMyOperation>;
363
- export const CommentDocument = gql`
364
- query Comment($repoFullName: String!, $limit: Int, $offset: Int) {
365
- currentUser {
366
- login
367
- html_url
368
- }
369
- entry(repoFullName: $repoFullName) {
370
- id
371
- postedBy {
372
- login
373
- html_url
374
- }
375
- createdAt
376
- comments(limit: $limit, offset: $offset) {
377
- ...CommentsPageComment
378
- }
379
- commentCount
380
- repository {
381
- full_name
382
- html_url
383
- ... on Repository {
384
- description
385
- open_issues_count
386
- stargazers_count
387
- }
388
- }
389
- }
390
- }
391
- ${CommentsPageCommentFragmentDoc}
392
- `;
393
-
394
- /**
395
- * __useCommentQuery__
396
- *
397
- * To run a query within a React component, call `useCommentQuery` and pass it any options that fit your needs.
398
- * When your component renders, `useCommentQuery` returns an object from Apollo Client that contains loading, error, and data properties
399
- * you can use to render your UI.
400
- *
401
- * @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;
402
- *
403
- * @example
404
- * const { data, loading, error } = useCommentQuery({
405
- * variables: {
406
- * repoFullName: // value for 'repoFullName'
407
- * limit: // value for 'limit'
408
- * offset: // value for 'offset'
409
- * },
410
- * });
411
- */
412
- export function useCommentQuery(baseOptions?: Apollo.QueryHookOptions<CommentQueryMyOperation, CommentQueryVariables>) {
413
- return Apollo.useQuery<CommentQueryMyOperation, CommentQueryVariables>(CommentDocument, baseOptions);
414
- }
415
- export function useCommentLazyQuery(
416
- baseOptions?: Apollo.LazyQueryHookOptions<CommentQueryMyOperation, CommentQueryVariables>
417
- ) {
418
- return Apollo.useLazyQuery<CommentQueryMyOperation, CommentQueryVariables>(CommentDocument, baseOptions);
419
- }
420
- export type CommentQueryHookResult = ReturnType<typeof useCommentQuery>;
421
- export type CommentLazyQueryHookResult = ReturnType<typeof useCommentLazyQuery>;
422
- export type CommentQueryResult = Apollo.QueryResult<CommentQueryMyOperation, CommentQueryVariables>;
423
- export const CurrentUserForProfileDocument = gql`
424
- query CurrentUserForProfile {
425
- currentUser {
426
- login
427
- avatar_url
428
- }
429
- }
430
- `;
431
-
432
- /**
433
- * __useCurrentUserForProfileQuery__
434
- *
435
- * To run a query within a React component, call `useCurrentUserForProfileQuery` and pass it any options that fit your needs.
436
- * When your component renders, `useCurrentUserForProfileQuery` returns an object from Apollo Client that contains loading, error, and data properties
437
- * you can use to render your UI.
438
- *
439
- * @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;
440
- *
441
- * @example
442
- * const { data, loading, error } = useCurrentUserForProfileQuery({
443
- * variables: {
444
- * },
445
- * });
446
- */
447
- export function useCurrentUserForProfileQuery(
448
- baseOptions?: Apollo.QueryHookOptions<CurrentUserForProfileQueryMyOperation, CurrentUserForProfileQueryVariables>
449
- ) {
450
- return Apollo.useQuery<CurrentUserForProfileQueryMyOperation, CurrentUserForProfileQueryVariables>(
451
- CurrentUserForProfileDocument,
452
- baseOptions
453
- );
454
- }
455
- export function useCurrentUserForProfileLazyQuery(
456
- baseOptions?: Apollo.LazyQueryHookOptions<CurrentUserForProfileQueryMyOperation, CurrentUserForProfileQueryVariables>
457
- ) {
458
- return Apollo.useLazyQuery<CurrentUserForProfileQueryMyOperation, CurrentUserForProfileQueryVariables>(
459
- CurrentUserForProfileDocument,
460
- baseOptions
461
- );
462
- }
463
- export type CurrentUserForProfileQueryHookResult = ReturnType<typeof useCurrentUserForProfileQuery>;
464
- export type CurrentUserForProfileLazyQueryHookResult = ReturnType<typeof useCurrentUserForProfileLazyQuery>;
465
- export type CurrentUserForProfileQueryResult = Apollo.QueryResult<
466
- CurrentUserForProfileQueryMyOperation,
467
- CurrentUserForProfileQueryVariables
468
- >;
469
- export const FeedDocument = gql`
470
- query Feed($type: FeedType!, $offset: Int, $limit: Int) {
471
- currentUser {
472
- login
473
- }
474
- feed(type: $type, offset: $offset, limit: $limit) {
475
- ...FeedEntry
476
- }
477
- }
478
- ${FeedEntryFragmentDoc}
479
- `;
480
-
481
- /**
482
- * __useFeedQuery__
483
- *
484
- * To run a query within a React component, call `useFeedQuery` and pass it any options that fit your needs.
485
- * When your component renders, `useFeedQuery` returns an object from Apollo Client that contains loading, error, and data properties
486
- * you can use to render your UI.
487
- *
488
- * @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;
489
- *
490
- * @example
491
- * const { data, loading, error } = useFeedQuery({
492
- * variables: {
493
- * type: // value for 'type'
494
- * offset: // value for 'offset'
495
- * limit: // value for 'limit'
496
- * },
497
- * });
498
- */
499
- export function useFeedQuery(baseOptions?: Apollo.QueryHookOptions<FeedQueryMyOperation, FeedQueryVariables>) {
500
- return Apollo.useQuery<FeedQueryMyOperation, FeedQueryVariables>(FeedDocument, baseOptions);
501
- }
502
- export function useFeedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FeedQueryMyOperation, FeedQueryVariables>) {
503
- return Apollo.useLazyQuery<FeedQueryMyOperation, FeedQueryVariables>(FeedDocument, baseOptions);
504
- }
505
- export type FeedQueryHookResult = ReturnType<typeof useFeedQuery>;
506
- export type FeedLazyQueryHookResult = ReturnType<typeof useFeedLazyQuery>;
507
- export type FeedQueryResult = Apollo.QueryResult<FeedQueryMyOperation, FeedQueryVariables>;
508
- export const SubmitRepositoryDocument = gql`
509
- mutation submitRepository($repoFullName: String!) {
510
- submitRepository(repoFullName: $repoFullName) {
511
- createdAt
512
- }
513
- }
514
- `;
515
- export type SubmitRepositoryMutationFn = Apollo.MutationFunction<
516
- SubmitRepositoryMutationMyOperation,
517
- SubmitRepositoryMutationVariables
518
- >;
519
-
520
- /**
521
- * __useSubmitRepositoryMutation__
522
- *
523
- * To run a mutation, you first call `useSubmitRepositoryMutation` within a React component and pass it any options that fit your needs.
524
- * When your component renders, `useSubmitRepositoryMutation` returns a tuple that includes:
525
- * - A mutate function that you can call at any time to execute the mutation
526
- * - An object with fields that represent the current status of the mutation's execution
527
- *
528
- * @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;
529
- *
530
- * @example
531
- * const [submitRepositoryMutation, { data, loading, error }] = useSubmitRepositoryMutation({
532
- * variables: {
533
- * repoFullName: // value for 'repoFullName'
534
- * },
535
- * });
536
- */
537
- export function useSubmitRepositoryMutation(
538
- baseOptions?: Apollo.MutationHookOptions<SubmitRepositoryMutationMyOperation, SubmitRepositoryMutationVariables>
539
- ) {
540
- return Apollo.useMutation<SubmitRepositoryMutationMyOperation, SubmitRepositoryMutationVariables>(
541
- SubmitRepositoryDocument,
542
- baseOptions
543
- );
544
- }
545
- export type SubmitRepositoryMutationHookResult = ReturnType<typeof useSubmitRepositoryMutation>;
546
- export type SubmitRepositoryMutationResult = Apollo.MutationResult<SubmitRepositoryMutationMyOperation>;
547
- export type SubmitRepositoryMutationOptions = Apollo.BaseMutationOptions<
548
- SubmitRepositoryMutationMyOperation,
549
- SubmitRepositoryMutationVariables
550
- >;
551
- export const SubmitCommentDocument = gql`
552
- mutation submitComment($repoFullName: String!, $commentContent: String!) {
553
- submitComment(repoFullName: $repoFullName, commentContent: $commentContent) {
554
- ...CommentsPageComment
555
- }
556
- }
557
- ${CommentsPageCommentFragmentDoc}
558
- `;
559
- export type SubmitCommentMutationFn = Apollo.MutationFunction<
560
- SubmitCommentMutationMyOperation,
561
- SubmitCommentMutationVariables
562
- >;
563
-
564
- /**
565
- * __useSubmitCommentMutation__
566
- *
567
- * To run a mutation, you first call `useSubmitCommentMutation` within a React component and pass it any options that fit your needs.
568
- * When your component renders, `useSubmitCommentMutation` returns a tuple that includes:
569
- * - A mutate function that you can call at any time to execute the mutation
570
- * - An object with fields that represent the current status of the mutation's execution
571
- *
572
- * @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;
573
- *
574
- * @example
575
- * const [submitCommentMutation, { data, loading, error }] = useSubmitCommentMutation({
576
- * variables: {
577
- * repoFullName: // value for 'repoFullName'
578
- * commentContent: // value for 'commentContent'
579
- * },
580
- * });
581
- */
582
- export function useSubmitCommentMutation(
583
- baseOptions?: Apollo.MutationHookOptions<SubmitCommentMutationMyOperation, SubmitCommentMutationVariables>
584
- ) {
585
- return Apollo.useMutation<SubmitCommentMutationMyOperation, SubmitCommentMutationVariables>(
586
- SubmitCommentDocument,
587
- baseOptions
588
- );
589
- }
590
- export type SubmitCommentMutationHookResult = ReturnType<typeof useSubmitCommentMutation>;
591
- export type SubmitCommentMutationResult = Apollo.MutationResult<SubmitCommentMutationMyOperation>;
592
- export type SubmitCommentMutationOptions = Apollo.BaseMutationOptions<
593
- SubmitCommentMutationMyOperation,
594
- SubmitCommentMutationVariables
595
- >;
596
- export const VoteDocument = gql`
597
- mutation vote($repoFullName: String!, $type: VoteType!) {
598
- vote(repoFullName: $repoFullName, type: $type) {
599
- score
600
- id
601
- vote {
602
- vote_value
603
- }
604
- }
605
- }
606
- `;
607
- export type VoteMutationFn = Apollo.MutationFunction<VoteMutationMyOperation, VoteMutationVariables>;
608
-
609
- /**
610
- * __useVoteMutation__
611
- *
612
- * To run a mutation, you first call `useVoteMutation` within a React component and pass it any options that fit your needs.
613
- * When your component renders, `useVoteMutation` returns a tuple that includes:
614
- * - A mutate function that you can call at any time to execute the mutation
615
- * - An object with fields that represent the current status of the mutation's execution
616
- *
617
- * @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;
618
- *
619
- * @example
620
- * const [voteMutation, { data, loading, error }] = useVoteMutation({
621
- * variables: {
622
- * repoFullName: // value for 'repoFullName'
623
- * type: // value for 'type'
624
- * },
625
- * });
626
- */
627
- export function useVoteMutation(
628
- baseOptions?: Apollo.MutationHookOptions<VoteMutationMyOperation, VoteMutationVariables>
629
- ) {
630
- return Apollo.useMutation<VoteMutationMyOperation, VoteMutationVariables>(VoteDocument, baseOptions);
631
- }
632
- export type VoteMutationHookResult = ReturnType<typeof useVoteMutation>;
633
- export type VoteMutationResult = Apollo.MutationResult<VoteMutationMyOperation>;
634
- export type VoteMutationOptions = Apollo.BaseMutationOptions<VoteMutationMyOperation, VoteMutationVariables>;