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