-
Notifications
You must be signed in to change notification settings - Fork 195
Expand file tree
/
Copy pathHeroDetailsWithFragment.tsx
More file actions
92 lines (88 loc) · 3.08 KB
/
HeroDetailsWithFragment.tsx
File metadata and controls
92 lines (88 loc) · 3.08 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
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
import * as Types from '../types.d.js';
import { HeroDetailsFragmentDoc } from './HeroDetailsFragment.js';
const defaultOptions = {} as const;
export type HeroDetailsWithFragmentQueryVariables = Types.Exact<{
episode?: Types.InputMaybe<Types.Episode>;
}>;
export type HeroDetailsWithFragmentQuery = {
__typename?: 'Query';
hero?:
| { __typename?: 'Droid'; primaryFunction?: string | null; name: string }
| { __typename?: 'Human'; height?: number | null; name: string }
| null;
};
export const HeroDetailsWithFragmentDocument = gql`
query HeroDetailsWithFragment($episode: Episode) {
hero(episode: $episode) {
...HeroDetails
}
}
${HeroDetailsFragmentDoc}
`;
/**
* __useHeroDetailsWithFragmentQuery__
*
* To run a query within a React component, call `useHeroDetailsWithFragmentQuery` and pass it any options that fit your needs.
* When your component renders, `useHeroDetailsWithFragmentQuery` 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 } = useHeroDetailsWithFragmentQuery({
* variables: {
* episode: // value for 'episode'
* },
* });
*/
export function useHeroDetailsWithFragmentQuery(
baseOptions?: Apollo.QueryHookOptions<
HeroDetailsWithFragmentQuery,
HeroDetailsWithFragmentQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<HeroDetailsWithFragmentQuery, HeroDetailsWithFragmentQueryVariables>(
HeroDetailsWithFragmentDocument,
options,
);
}
export function useHeroDetailsWithFragmentLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
HeroDetailsWithFragmentQuery,
HeroDetailsWithFragmentQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<HeroDetailsWithFragmentQuery, HeroDetailsWithFragmentQueryVariables>(
HeroDetailsWithFragmentDocument,
options,
);
}
export function useHeroDetailsWithFragmentSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
HeroDetailsWithFragmentQuery,
HeroDetailsWithFragmentQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
HeroDetailsWithFragmentQuery,
HeroDetailsWithFragmentQueryVariables
>(HeroDetailsWithFragmentDocument, options);
}
export type HeroDetailsWithFragmentQueryHookResult = ReturnType<
typeof useHeroDetailsWithFragmentQuery
>;
export type HeroDetailsWithFragmentLazyQueryHookResult = ReturnType<
typeof useHeroDetailsWithFragmentLazyQuery
>;
export type HeroDetailsWithFragmentSuspenseQueryHookResult = ReturnType<
typeof useHeroDetailsWithFragmentSuspenseQuery
>;
export type HeroDetailsWithFragmentQueryResult = Apollo.QueryResult<
HeroDetailsWithFragmentQuery,
HeroDetailsWithFragmentQueryVariables
>;