-
Notifications
You must be signed in to change notification settings - Fork 195
Expand file tree
/
Copy pathHeroAppearsIn.tsx
More file actions
73 lines (69 loc) · 2.53 KB
/
HeroAppearsIn.tsx
File metadata and controls
73 lines (69 loc) · 2.53 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
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
import * as Types from '../types.d.js';
const defaultOptions = {} as const;
export type HeroAppearsInQueryVariables = Types.Exact<{ [key: string]: never }>;
export type HeroAppearsInQuery = {
__typename?: 'Query';
hero?:
| { __typename?: 'Droid'; name: string; appearsIn: Array<Types.Episode | null> }
| { __typename?: 'Human'; name: string; appearsIn: Array<Types.Episode | null> }
| null;
};
export const HeroAppearsInDocument = gql`
query HeroAppearsIn {
hero {
name
appearsIn
}
}
`;
/**
* __useHeroAppearsInQuery__
*
* To run a query within a React component, call `useHeroAppearsInQuery` and pass it any options that fit your needs.
* When your component renders, `useHeroAppearsInQuery` 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 } = useHeroAppearsInQuery({
* variables: {
* },
* });
*/
export function useHeroAppearsInQuery(
baseOptions?: Apollo.QueryHookOptions<HeroAppearsInQuery, HeroAppearsInQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<HeroAppearsInQuery, HeroAppearsInQueryVariables>(
HeroAppearsInDocument,
options,
);
}
export function useHeroAppearsInLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<HeroAppearsInQuery, HeroAppearsInQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<HeroAppearsInQuery, HeroAppearsInQueryVariables>(
HeroAppearsInDocument,
options,
);
}
export function useHeroAppearsInSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<HeroAppearsInQuery, HeroAppearsInQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<HeroAppearsInQuery, HeroAppearsInQueryVariables>(
HeroAppearsInDocument,
options,
);
}
export type HeroAppearsInQueryHookResult = ReturnType<typeof useHeroAppearsInQuery>;
export type HeroAppearsInLazyQueryHookResult = ReturnType<typeof useHeroAppearsInLazyQuery>;
export type HeroAppearsInSuspenseQueryHookResult = ReturnType<typeof useHeroAppearsInSuspenseQuery>;
export type HeroAppearsInQueryResult = Apollo.QueryResult<
HeroAppearsInQuery,
HeroAppearsInQueryVariables
>;