-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
HeroAndFriendsNames.tsx
76 lines (72 loc) · 2.58 KB
/
HeroAndFriendsNames.tsx
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
import * as Types from '../types.d.js';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type HeroAndFriendsNamesQueryVariables = Types.Exact<{
episode?: Types.InputMaybe<Types.Episode>;
}>;
export type HeroAndFriendsNamesQuery = {
__typename?: 'Query';
hero?:
| {
__typename?: 'Droid';
name: string;
friends?: Array<{ __typename?: 'Droid'; name: string } | { __typename?: 'Human'; name: string } | null> | null;
}
| {
__typename?: 'Human';
name: string;
friends?: Array<{ __typename?: 'Droid'; name: string } | { __typename?: 'Human'; name: string } | null> | null;
}
| null;
};
export const HeroAndFriendsNamesDocument = gql`
query HeroAndFriendsNames($episode: Episode) {
hero(episode: $episode) {
name
friends {
name
}
}
}
`;
/**
* __useHeroAndFriendsNamesQuery__
*
* To run a query within a React component, call `useHeroAndFriendsNamesQuery` and pass it any options that fit your needs.
* When your component renders, `useHeroAndFriendsNamesQuery` 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 } = useHeroAndFriendsNamesQuery({
* variables: {
* episode: // value for 'episode'
* },
* });
*/
export function useHeroAndFriendsNamesQuery(
baseOptions?: Apollo.QueryHookOptions<HeroAndFriendsNamesQuery, HeroAndFriendsNamesQueryVariables>
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<HeroAndFriendsNamesQuery, HeroAndFriendsNamesQueryVariables>(
HeroAndFriendsNamesDocument,
options
);
}
export function useHeroAndFriendsNamesLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<HeroAndFriendsNamesQuery, HeroAndFriendsNamesQueryVariables>
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<HeroAndFriendsNamesQuery, HeroAndFriendsNamesQueryVariables>(
HeroAndFriendsNamesDocument,
options
);
}
export type HeroAndFriendsNamesQueryHookResult = ReturnType<typeof useHeroAndFriendsNamesQuery>;
export type HeroAndFriendsNamesLazyQueryHookResult = ReturnType<typeof useHeroAndFriendsNamesLazyQuery>;
export type HeroAndFriendsNamesQueryResult = Apollo.QueryResult<
HeroAndFriendsNamesQuery,
HeroAndFriendsNamesQueryVariables
>;