1 | type Maybe<T> = T | null;
|
2 |
|
3 | export type Scalars = {
|
4 | ID: string;
|
5 | String: string;
|
6 | Boolean: boolean;
|
7 | Int: number;
|
8 | Float: number;
|
9 | };
|
10 |
|
11 | export type MyType = {
|
12 | f?: Maybe<Scalars['String']>;
|
13 | };
|
14 |
|
15 | export type Query = {
|
16 | f?: Maybe<Scalars['String']>;
|
17 | };
|
18 | export type MyQueryQueryVariables = {};
|
19 |
|
20 | export type MyQueryQuery = { __typename?: 'Query' } & Pick<Query, 'f'>;
|
21 |
|
22 | import gql from 'graphql-tag';
|
23 | import * as React from 'react';
|
24 | import * as ReactApollo from 'react-apollo';
|
25 | export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
26 |
|
27 | export const MyQueryDocument = gql`
|
28 | query MyQuery {
|
29 | f
|
30 | }
|
31 | `;
|
32 |
|
33 | export const MyQueryComponent = (props: Omit<Omit<ReactApollo.QueryProps<MyQueryQuery, MyQueryQueryVariables>, 'query'>, 'variables'> & { variables?: MyQueryQueryVariables }) => (
|
34 | <ReactApollo.Query<MyQueryQuery, MyQueryQueryVariables> query={MyQueryDocument} {...props} />
|
35 | );
|
36 |
|
37 | export type MyQueryProps<TChildProps = {}> = Partial<ReactApollo.DataProps<MyQueryQuery, MyQueryQueryVariables>> & TChildProps;
|
38 | export function withMyQuery<TProps, TChildProps = {}>(operationOptions?: ReactApollo.OperationOption<TProps, MyQueryQuery, MyQueryQueryVariables, MyQueryProps<TChildProps>>) {
|
39 | return ReactApollo.withQuery<TProps, MyQueryQuery, MyQueryQueryVariables, MyQueryProps<TChildProps>>(MyQueryDocument, operationOptions);
|
40 | }
|