/
appData.ts
66 lines (57 loc) · 2.4 KB
/
appData.ts
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
/* eslint-disable */
// @ts-nocheck
/**
* ФАЙЛ ГЕНЕРИРУЕТСЯ АВТОМАТИЧЕСКИ, ПРАВИТЬ ЕГО НЕ НУЖНО
* Команда для генерирования этого файла: "yarn generate:types"
*/
import * as Types from './types';
import { CityFragment } from './city';
import { gql } from '@apollo/client';
import { CityFragmentDoc } from './city';
import * as Apollo from '@apollo/client';
const defaultOptions = {}
export type AppDataQueryVariables = Types.Exact<{ [key: string]: never; }>;
export type AppDataQuery = { __typename?: 'Query', cities: Array<(
{ __typename?: 'City' }
& CityFragment
)>, companies_rating: Array<{ __typename?: 'Votes', type?: Types.Maybe<number>, target_id: number, avg: { __typename?: 'VotesAvg', voteValueAvg: number } }> };
export const AppDataDocument = gql`
query appData {
cities(orderBy: {pagetitle: asc}) {
...city
}
companies_rating: votesByRating {
type
target_id
avg {
voteValueAvg
}
}
}
${CityFragmentDoc}`;
/**
* __useAppDataQuery__
*
* To run a query within a React component, call `useAppDataQuery` and pass it any options that fit your needs.
* When your component renders, `useAppDataQuery` 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 } = useAppDataQuery({
* variables: {
* },
* });
*/
export function useAppDataQuery(baseOptions?: Apollo.QueryHookOptions<AppDataQuery, AppDataQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<AppDataQuery, AppDataQueryVariables>(AppDataDocument, options);
}
export function useAppDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<AppDataQuery, AppDataQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<AppDataQuery, AppDataQueryVariables>(AppDataDocument, options);
}
export type AppDataQueryHookResult = ReturnType<typeof useAppDataQuery>;
export type AppDataLazyQueryHookResult = ReturnType<typeof useAppDataLazyQuery>;
export type AppDataQueryResult = Apollo.QueryResult<AppDataQuery, AppDataQueryVariables>;