-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathgenerated-models.ts
More file actions
executable file
·572 lines (499 loc) · 22.6 KB
/
generated-models.ts
File metadata and controls
executable file
·572 lines (499 loc) · 22.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
/* tslint:disable */
import { GraphQLResolveInfo } from 'graphql';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
export type Maybe<T> = T | null;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
export type RequireFields<T, K extends keyof T> = { [X in Exclude<keyof T, K>]?: T[X] } & { [P in K]-?: NonNullable<T[P]> };
const defaultOptions = {}
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
String: string;
Boolean: boolean;
Int: number;
Float: number;
};
export type ClientCounter = {
__typename?: 'ClientCounter';
counter?: Maybe<Scalars['Int']>;
};
/** Database counter */
export type Counter = {
__typename?: 'Counter';
/** Current amount */
amount: Scalars['Int'];
};
export type Mutation = {
__typename?: 'Mutation';
/** Increase counter value returns current counter amount */
addCounter?: Maybe<Counter>;
addCounterState?: Maybe<ClientCounter>;
/** add Counter */
addMoleculerCounter?: Maybe<Counter>;
/** sync cached counter with current value */
syncCachedCounter?: Maybe<Scalars['Boolean']>;
};
export type MutationAddCounterArgs = {
amount?: Maybe<Scalars['Int']>;
};
export type MutationAddCounterStateArgs = {
amount: Scalars['Int'];
};
export type MutationAddMoleculerCounterArgs = {
amount?: Maybe<Scalars['Int']>;
};
export type Query = {
__typename?: 'Query';
/** Counter */
counter?: Maybe<Counter>;
/** Counter from Datasource */
counterCache?: Maybe<Counter>;
counterState?: Maybe<ClientCounter>;
/** Moleculer Counter */
moleculerCounter?: Maybe<Counter>;
};
export type Subscription = {
__typename?: 'Subscription';
/** Subscription fired when anyone increases counter */
counterUpdated?: Maybe<Counter>;
moleculerCounterUpdate?: Maybe<Counter>;
};
export type AddCounterStateMutationVariables = Exact<{
amount: Scalars['Int'];
}>;
export type AddCounterStateMutation = (
{ __typename?: 'Mutation' }
& { addCounterState?: Maybe<(
{ __typename?: 'ClientCounter' }
& Pick<ClientCounter, 'counter'>
)> }
);
export type AddCounterMutationVariables = Exact<{
amount: Scalars['Int'];
}>;
export type AddCounterMutation = (
{ __typename?: 'Mutation' }
& { addCounter?: Maybe<(
{ __typename?: 'Counter' }
& Pick<Counter, 'amount'>
)> }
);
export type AddCounter_WsMutationVariables = Exact<{
amount: Scalars['Int'];
}>;
export type AddCounter_WsMutation = (
{ __typename?: 'Mutation' }
& { addCounter?: Maybe<(
{ __typename?: 'Counter' }
& Pick<Counter, 'amount'>
)> }
);
export type SyncCachedCounterMutationVariables = Exact<{ [key: string]: never; }>;
export type SyncCachedCounterMutation = (
{ __typename?: 'Mutation' }
& Pick<Mutation, 'syncCachedCounter'>
);
export type CounterCacheQueryQueryVariables = Exact<{ [key: string]: never; }>;
export type CounterCacheQueryQuery = (
{ __typename?: 'Query' }
& { counterCache?: Maybe<(
{ __typename?: 'Counter' }
& Pick<Counter, 'amount'>
)> }
);
export type CounterStateQueryVariables = Exact<{ [key: string]: never; }>;
export type CounterStateQuery = (
{ __typename?: 'Query' }
& { counterState?: Maybe<(
{ __typename?: 'ClientCounter' }
& Pick<ClientCounter, 'counter'>
)> }
);
export type CounterQueryQueryVariables = Exact<{ [key: string]: never; }>;
export type CounterQueryQuery = (
{ __typename?: 'Query' }
& { counter?: Maybe<(
{ __typename?: 'Counter' }
& Pick<Counter, 'amount'>
)> }
);
export type OnCounterUpdatedSubscriptionVariables = Exact<{ [key: string]: never; }>;
export type OnCounterUpdatedSubscription = (
{ __typename?: 'Subscription' }
& { counterUpdated?: Maybe<(
{ __typename?: 'Counter' }
& Pick<Counter, 'amount'>
)> }
);
export type ResolverTypeWrapper<T> = Promise<T> | T;
export type ResolverWithResolve<TResult, TParent, TContext, TArgs> = {
resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
};
export type LegacyStitchingResolver<TResult, TParent, TContext, TArgs> = {
fragment: string;
resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
};
export type NewStitchingResolver<TResult, TParent, TContext, TArgs> = {
selectionSet: string;
resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
};
export type StitchingResolver<TResult, TParent, TContext, TArgs> = LegacyStitchingResolver<TResult, TParent, TContext, TArgs> | NewStitchingResolver<TResult, TParent, TContext, TArgs>;
export type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> =
| ResolverFn<TResult, TParent, TContext, TArgs>
| ResolverWithResolve<TResult, TParent, TContext, TArgs>
| StitchingResolver<TResult, TParent, TContext, TArgs>;
export type ResolverFn<TResult, TParent, TContext, TArgs> = (
parent: TParent,
args: TArgs,
context: TContext,
info: GraphQLResolveInfo
) => Promise<TResult> | TResult;
export type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (
parent: TParent,
args: TArgs,
context: TContext,
info: GraphQLResolveInfo
) => AsyncIterator<TResult> | Promise<AsyncIterator<TResult>>;
export type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = (
parent: TParent,
args: TArgs,
context: TContext,
info: GraphQLResolveInfo
) => TResult | Promise<TResult>;
export interface SubscriptionSubscriberObject<TResult, TKey extends string, TParent, TContext, TArgs> {
subscribe: SubscriptionSubscribeFn<{ [key in TKey]: TResult }, TParent, TContext, TArgs>;
resolve?: SubscriptionResolveFn<TResult, { [key in TKey]: TResult }, TContext, TArgs>;
}
export interface SubscriptionResolverObject<TResult, TParent, TContext, TArgs> {
subscribe: SubscriptionSubscribeFn<any, TParent, TContext, TArgs>;
resolve: SubscriptionResolveFn<TResult, any, TContext, TArgs>;
}
export type SubscriptionObject<TResult, TKey extends string, TParent, TContext, TArgs> =
| SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs>
| SubscriptionResolverObject<TResult, TParent, TContext, TArgs>;
export type SubscriptionResolver<TResult, TKey extends string, TParent = {}, TContext = {}, TArgs = {}> =
| ((...args: any[]) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>)
| SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>;
export type TypeResolveFn<TTypes, TParent = {}, TContext = {}> = (
parent: TParent,
context: TContext,
info: GraphQLResolveInfo
) => Maybe<TTypes> | Promise<Maybe<TTypes>>;
export type IsTypeOfResolverFn<T = {}, TContext = {}> = (obj: T, context: TContext, info: GraphQLResolveInfo) => boolean | Promise<boolean>;
export type NextResolverFn<T> = () => Promise<T>;
export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs = {}> = (
next: NextResolverFn<TResult>,
parent: TParent,
args: TArgs,
context: TContext,
info: GraphQLResolveInfo
) => TResult | Promise<TResult>;
/** Mapping between all available schema types and the resolvers types */
export type ResolversTypes = {
ClientCounter: ResolverTypeWrapper<ClientCounter>;
Int: ResolverTypeWrapper<Scalars['Int']>;
Counter: ResolverTypeWrapper<Counter>;
Mutation: ResolverTypeWrapper<{}>;
Boolean: ResolverTypeWrapper<Scalars['Boolean']>;
Query: ResolverTypeWrapper<{}>;
Subscription: ResolverTypeWrapper<{}>;
String: ResolverTypeWrapper<Scalars['String']>;
};
/** Mapping between all available schema types and the resolvers parents */
export type ResolversParentTypes = {
ClientCounter: ClientCounter;
Int: Scalars['Int'];
Counter: Counter;
Mutation: {};
Boolean: Scalars['Boolean'];
Query: {};
Subscription: {};
String: Scalars['String'];
};
export type ClientCounterResolvers<ContextType = any, ParentType extends ResolversParentTypes['ClientCounter'] = ResolversParentTypes['ClientCounter']> = {
counter?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};
export type CounterResolvers<ContextType = any, ParentType extends ResolversParentTypes['Counter'] = ResolversParentTypes['Counter']> = {
amount?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};
export type MutationResolvers<ContextType = any, ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']> = {
addCounter?: Resolver<Maybe<ResolversTypes['Counter']>, ParentType, ContextType, RequireFields<MutationAddCounterArgs, never>>;
addCounterState?: Resolver<Maybe<ResolversTypes['ClientCounter']>, ParentType, ContextType, RequireFields<MutationAddCounterStateArgs, 'amount'>>;
addMoleculerCounter?: Resolver<Maybe<ResolversTypes['Counter']>, ParentType, ContextType, RequireFields<MutationAddMoleculerCounterArgs, never>>;
syncCachedCounter?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
};
export type QueryResolvers<ContextType = any, ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']> = {
counter?: Resolver<Maybe<ResolversTypes['Counter']>, ParentType, ContextType>;
counterCache?: Resolver<Maybe<ResolversTypes['Counter']>, ParentType, ContextType>;
counterState?: Resolver<Maybe<ResolversTypes['ClientCounter']>, ParentType, ContextType>;
moleculerCounter?: Resolver<Maybe<ResolversTypes['Counter']>, ParentType, ContextType>;
};
export type SubscriptionResolvers<ContextType = any, ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']> = {
counterUpdated?: SubscriptionResolver<Maybe<ResolversTypes['Counter']>, "counterUpdated", ParentType, ContextType>;
moleculerCounterUpdate?: SubscriptionResolver<Maybe<ResolversTypes['Counter']>, "moleculerCounterUpdate", ParentType, ContextType>;
};
export type Resolvers<ContextType = any> = {
ClientCounter?: ClientCounterResolvers<ContextType>;
Counter?: CounterResolvers<ContextType>;
Mutation?: MutationResolvers<ContextType>;
Query?: QueryResolvers<ContextType>;
Subscription?: SubscriptionResolvers<ContextType>;
};
/**
* @deprecated
* Use "Resolvers" root object instead. If you wish to get "IResolvers", add "typesPrefix: I" to your config.
*/
export type IResolvers<ContextType = any> = Resolvers<ContextType>;
export const AddCounterStateDocument = gql`
mutation addCounterState($amount: Int!) {
addCounterState(amount: $amount) @client {
counter
}
}
`;
/**
* __useAddCounterStateMutation__
*
* To run a mutation, you first call `useAddCounterStateMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useAddCounterStateMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @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;
*
* @example
* const [addCounterStateMutation, { data, loading, error }] = useAddCounterStateMutation({
* variables: {
* amount: // value for 'amount'
* },
* });
*/
export function useAddCounterStateMutation(baseOptions?: Apollo.MutationHookOptions<AddCounterStateMutation, AddCounterStateMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<AddCounterStateMutation, AddCounterStateMutationVariables>(AddCounterStateDocument, options);
}
export type AddCounterStateMutationHookResult = ReturnType<typeof useAddCounterStateMutation>;
export type AddCounterStateMutationResult = Apollo.MutationResult<AddCounterStateMutation>;
export type AddCounterStateMutationOptions = Apollo.BaseMutationOptions<AddCounterStateMutation, AddCounterStateMutationVariables>;
export const AddCounterDocument = gql`
mutation addCounter($amount: Int!) {
addCounter(amount: $amount) {
amount
}
}
`;
/**
* __useAddCounterMutation__
*
* To run a mutation, you first call `useAddCounterMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useAddCounterMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @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;
*
* @example
* const [addCounterMutation, { data, loading, error }] = useAddCounterMutation({
* variables: {
* amount: // value for 'amount'
* },
* });
*/
export function useAddCounterMutation(baseOptions?: Apollo.MutationHookOptions<AddCounterMutation, AddCounterMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<AddCounterMutation, AddCounterMutationVariables>(AddCounterDocument, options);
}
export type AddCounterMutationHookResult = ReturnType<typeof useAddCounterMutation>;
export type AddCounterMutationResult = Apollo.MutationResult<AddCounterMutation>;
export type AddCounterMutationOptions = Apollo.BaseMutationOptions<AddCounterMutation, AddCounterMutationVariables>;
export const AddCounter_WsDocument = gql`
mutation AddCounter_WS($amount: Int!) {
addCounter(amount: $amount) {
amount
}
}
`;
/**
* __useAddCounter_WsMutation__
*
* To run a mutation, you first call `useAddCounter_WsMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useAddCounter_WsMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @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;
*
* @example
* const [addCounterWsMutation, { data, loading, error }] = useAddCounter_WsMutation({
* variables: {
* amount: // value for 'amount'
* },
* });
*/
export function useAddCounter_WsMutation(baseOptions?: Apollo.MutationHookOptions<AddCounter_WsMutation, AddCounter_WsMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<AddCounter_WsMutation, AddCounter_WsMutationVariables>(AddCounter_WsDocument, options);
}
export type AddCounter_WsMutationHookResult = ReturnType<typeof useAddCounter_WsMutation>;
export type AddCounter_WsMutationResult = Apollo.MutationResult<AddCounter_WsMutation>;
export type AddCounter_WsMutationOptions = Apollo.BaseMutationOptions<AddCounter_WsMutation, AddCounter_WsMutationVariables>;
export const SyncCachedCounterDocument = gql`
mutation SyncCachedCounter {
syncCachedCounter
}
`;
/**
* __useSyncCachedCounterMutation__
*
* To run a mutation, you first call `useSyncCachedCounterMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useSyncCachedCounterMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @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;
*
* @example
* const [syncCachedCounterMutation, { data, loading, error }] = useSyncCachedCounterMutation({
* variables: {
* },
* });
*/
export function useSyncCachedCounterMutation(baseOptions?: Apollo.MutationHookOptions<SyncCachedCounterMutation, SyncCachedCounterMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<SyncCachedCounterMutation, SyncCachedCounterMutationVariables>(SyncCachedCounterDocument, options);
}
export type SyncCachedCounterMutationHookResult = ReturnType<typeof useSyncCachedCounterMutation>;
export type SyncCachedCounterMutationResult = Apollo.MutationResult<SyncCachedCounterMutation>;
export type SyncCachedCounterMutationOptions = Apollo.BaseMutationOptions<SyncCachedCounterMutation, SyncCachedCounterMutationVariables>;
export const CounterCacheQueryDocument = gql`
query counterCacheQuery {
counterCache {
amount
}
}
`;
/**
* __useCounterCacheQueryQuery__
*
* To run a query within a React component, call `useCounterCacheQueryQuery` and pass it any options that fit your needs.
* When your component renders, `useCounterCacheQueryQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @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;
*
* @example
* const { data, loading, error } = useCounterCacheQueryQuery({
* variables: {
* },
* });
*/
export function useCounterCacheQueryQuery(baseOptions?: Apollo.QueryHookOptions<CounterCacheQueryQuery, CounterCacheQueryQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<CounterCacheQueryQuery, CounterCacheQueryQueryVariables>(CounterCacheQueryDocument, options);
}
export function useCounterCacheQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CounterCacheQueryQuery, CounterCacheQueryQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<CounterCacheQueryQuery, CounterCacheQueryQueryVariables>(CounterCacheQueryDocument, options);
}
export type CounterCacheQueryQueryHookResult = ReturnType<typeof useCounterCacheQueryQuery>;
export type CounterCacheQueryLazyQueryHookResult = ReturnType<typeof useCounterCacheQueryLazyQuery>;
export type CounterCacheQueryQueryResult = Apollo.QueryResult<CounterCacheQueryQuery, CounterCacheQueryQueryVariables>;
export const CounterStateDocument = gql`
query CounterState {
counterState @client {
counter
}
}
`;
/**
* __useCounterStateQuery__
*
* To run a query within a React component, call `useCounterStateQuery` and pass it any options that fit your needs.
* When your component renders, `useCounterStateQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @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;
*
* @example
* const { data, loading, error } = useCounterStateQuery({
* variables: {
* },
* });
*/
export function useCounterStateQuery(baseOptions?: Apollo.QueryHookOptions<CounterStateQuery, CounterStateQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<CounterStateQuery, CounterStateQueryVariables>(CounterStateDocument, options);
}
export function useCounterStateLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CounterStateQuery, CounterStateQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<CounterStateQuery, CounterStateQueryVariables>(CounterStateDocument, options);
}
export type CounterStateQueryHookResult = ReturnType<typeof useCounterStateQuery>;
export type CounterStateLazyQueryHookResult = ReturnType<typeof useCounterStateLazyQuery>;
export type CounterStateQueryResult = Apollo.QueryResult<CounterStateQuery, CounterStateQueryVariables>;
export const CounterQueryDocument = gql`
query counterQuery {
counter {
amount
}
}
`;
/**
* __useCounterQueryQuery__
*
* To run a query within a React component, call `useCounterQueryQuery` and pass it any options that fit your needs.
* When your component renders, `useCounterQueryQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @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;
*
* @example
* const { data, loading, error } = useCounterQueryQuery({
* variables: {
* },
* });
*/
export function useCounterQueryQuery(baseOptions?: Apollo.QueryHookOptions<CounterQueryQuery, CounterQueryQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<CounterQueryQuery, CounterQueryQueryVariables>(CounterQueryDocument, options);
}
export function useCounterQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CounterQueryQuery, CounterQueryQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<CounterQueryQuery, CounterQueryQueryVariables>(CounterQueryDocument, options);
}
export type CounterQueryQueryHookResult = ReturnType<typeof useCounterQueryQuery>;
export type CounterQueryLazyQueryHookResult = ReturnType<typeof useCounterQueryLazyQuery>;
export type CounterQueryQueryResult = Apollo.QueryResult<CounterQueryQuery, CounterQueryQueryVariables>;
export const OnCounterUpdatedDocument = gql`
subscription onCounterUpdated {
counterUpdated {
amount
}
}
`;
/**
* __useOnCounterUpdatedSubscription__
*
* To run a query within a React component, call `useOnCounterUpdatedSubscription` and pass it any options that fit your needs.
* When your component renders, `useOnCounterUpdatedSubscription` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @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;
*
* @example
* const { data, loading, error } = useOnCounterUpdatedSubscription({
* variables: {
* },
* });
*/
export function useOnCounterUpdatedSubscription(baseOptions?: Apollo.SubscriptionHookOptions<OnCounterUpdatedSubscription, OnCounterUpdatedSubscriptionVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useSubscription<OnCounterUpdatedSubscription, OnCounterUpdatedSubscriptionVariables>(OnCounterUpdatedDocument, options);
}
export type OnCounterUpdatedSubscriptionHookResult = ReturnType<typeof useOnCounterUpdatedSubscription>;
export type OnCounterUpdatedSubscriptionResult = Apollo.SubscriptionResult<OnCounterUpdatedSubscription>;