- bumps to GraphQL Code Generator v1 - adds GraphQL named fragment support - removes `webpack-node-externals`, in favour of building a single `server.js` bundle - updates README for GraphQL Code Generator v1 - bumps NPM packages: @emotion/core ^10.0.7 → ^10.0.10 @emotion/styled ^10.0.7 → ^10.0.10 apollo-cache-inmemory ^1.4.3 → ^1.5.1 apollo-client ^2.4.13 → ^2.5.1 apollo-link ^1.2.8 → ^1.2.11 apollo-link-error ^1.1.7 → ^1.1.10 apollo-link-http ^1.5.11 → ^1.5.14 apollo-link-ws ^1.0.14 → ^1.0.17 apollo-utilities ^1.1.3 → ^1.2.1 cross-fetch ^3.0.1 → ^3.0.2 dotenv ^6.2.0 → ^7.0.0 emotion ^10.0.7 → ^10.0.9 graphql ^14.1.1 → ^14.2.1 history ^4.7.2 → ^4.9.0 ora ^3.1.0 → ^3.4.0 react ^16.8.2 → ^16.8.6 react-apollo ^2.4.1 → ^2.5.3 react-dom ^16.8.2 → ^16.8.6 react-hot-loader ^4.7.0 → ^4.8.2 react-router-dom ^4.3.1 → ^5.0.0 subscriptions-transport-ws ^0.9.15 → ^0.9.16 @babel/core ^7.3.3 → ^7.4.3 @hot-loader/react-dom ^16.8.2 → ^16.8.6 @types/koa-router ^7.0.39 → ^7.0.40 @types/koa-send ^4.1.1 → ^4.1.2 @types/lodash ^4.14.121 → ^4.14.123 @types/node ^11.9.4 → ^11.13.0 @types/ora ^3.0.0 → ^3.2.0 @types/prop-types ^15.5.9 → ^15.7.0 @types/react ^16.8.3 → ^16.8.12 @types/react-dom ^16.8.2 → ^16.8.3 @types/source-map-support ^0.4.2 → ^0.5.0 @types/webpack ^4.4.24 → ^4.4.27 @types/webpack-dev-server ^3.1.2 → ^3.1.5 babel-plugin-emotion ^10.0.7 → ^10.0.9 css-hot-loader ^1.4.3 → ^1.4.4 css-loader ^2.1.0 → ^2.1.1 koa-webpack ^5.2.1 → ^5.2.2 lint-staged ^8.1.4 → ^8.1.5 postcss-preset-env ^6.5.0 → ^6.6.0 resolve-url-loader ^3.0.1 → ^3.1.0 source-map-support ^0.5.10 → ^0.5.11 ts-node ^8.0.2 → ^8.0.3 tslint ^5.12.1 → ^5.15.0 typescript ^3.3.3 → ^3.4.1 webpack ^4.29.5 → ^4.29.6pull/162/head 4.3.0
parent
03203323ac
commit
34eee85603
@ -0,0 +1,15 @@ |
||||
# git |
||||
.github |
||||
**/.gitattributes |
||||
|
||||
# editors |
||||
.vscode |
||||
*.un~ |
||||
*.swp |
||||
|
||||
# NPM |
||||
**/node_modules |
||||
|
||||
# ext to ignore |
||||
**/*.svg |
||||
**/.DS_Store |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,19 @@ |
||||
export interface IntrospectionResultData { |
||||
__schema: { |
||||
types: { |
||||
kind: string; |
||||
name: string; |
||||
possibleTypes: { |
||||
name: string; |
||||
}[]; |
||||
}[]; |
||||
}; |
||||
} |
||||
|
||||
const result: IntrospectionResultData = { |
||||
__schema: { |
||||
types: [] |
||||
} |
||||
}; |
||||
|
||||
export default result; |
@ -1,85 +1,97 @@ |
||||
export type Maybe<T> = T | null; |
||||
type Maybe<T> = T | null; |
||||
/** All built-in and custom scalars, mapped to their actual values */ |
||||
export type Scalars = { |
||||
ID: string; |
||||
String: string; |
||||
Boolean: boolean; |
||||
Int: number; |
||||
Float: number; |
||||
}; |
||||
|
||||
// ====================================================
|
||||
// Documents
|
||||
// ====================================================
|
||||
export type HackerNews = { |
||||
topStories?: Maybe<Array<Maybe<Story>>>; |
||||
}; |
||||
|
||||
export namespace GetHackerNewsTopStories { |
||||
export type Variables = {}; |
||||
export type Query = { |
||||
hn?: Maybe<HackerNews>; |
||||
}; |
||||
|
||||
export type Query = { |
||||
__typename?: "Query"; |
||||
export type Story = { |
||||
id?: Maybe<Scalars["String"]>; |
||||
title?: Maybe<Scalars["String"]>; |
||||
url?: Maybe<Scalars["String"]>; |
||||
}; |
||||
export type GetHackerNewsTopStoriesQueryVariables = {}; |
||||
|
||||
hn: Maybe<Hn>; |
||||
}; |
||||
|
||||
export type Hn = { |
||||
__typename?: "HackerNews"; |
||||
|
||||
topStories: Maybe<(Maybe<TopStories>)[]>; |
||||
}; |
||||
|
||||
export type TopStories = { |
||||
__typename?: "Story"; |
||||
|
||||
id: Maybe<string>; |
||||
|
||||
title: Maybe<string>; |
||||
|
||||
url: Maybe<string>; |
||||
}; |
||||
} |
||||
|
||||
import * as ReactApollo from "react-apollo"; |
||||
import * as React from "react"; |
||||
export type GetHackerNewsTopStoriesQuery = { __typename?: "Query" } & { |
||||
hn: Maybe< |
||||
{ __typename?: "HackerNews" } & { |
||||
topStories: Maybe< |
||||
Array< |
||||
Maybe<{ __typename?: "Story" } & Pick<Story, "id" | "title" | "url">> |
||||
> |
||||
>; |
||||
} |
||||
>; |
||||
}; |
||||
|
||||
import gql from "graphql-tag"; |
||||
import * as React from "react"; |
||||
import * as ReactApollo from "react-apollo"; |
||||
|
||||
// ====================================================
|
||||
// Components
|
||||
// ====================================================
|
||||
|
||||
export namespace GetHackerNewsTopStories { |
||||
export const Document = gql` |
||||
query GetHackerNewsTopStories { |
||||
hn { |
||||
topStories { |
||||
id |
||||
title |
||||
url |
||||
} |
||||
export const GetHackerNewsTopStoriesDocument = gql` |
||||
query GetHackerNewsTopStories { |
||||
hn { |
||||
topStories { |
||||
id |
||||
title |
||||
url |
||||
} |
||||
} |
||||
`;
|
||||
export class Component extends React.Component< |
||||
Partial<ReactApollo.QueryProps<Query, Variables>> |
||||
> { |
||||
render() { |
||||
return ( |
||||
<ReactApollo.Query<Query, Variables> |
||||
query={Document} |
||||
{...(this as any)["props"] as any} |
||||
/> |
||||
); |
||||
} |
||||
} |
||||
export type Props<TChildProps = any> = Partial< |
||||
ReactApollo.DataProps<Query, Variables> |
||||
> & |
||||
TChildProps; |
||||
export function HOC<TProps, TChildProps = any>( |
||||
operationOptions: |
||||
| ReactApollo.OperationOption< |
||||
TProps, |
||||
Query, |
||||
Variables, |
||||
Props<TChildProps> |
||||
> |
||||
| undefined |
||||
) { |
||||
return ReactApollo.graphql<TProps, Query, Variables, Props<TChildProps>>( |
||||
Document, |
||||
operationOptions |
||||
`;
|
||||
|
||||
export class GetHackerNewsTopStoriesComponent extends React.Component< |
||||
Partial< |
||||
ReactApollo.QueryProps< |
||||
GetHackerNewsTopStoriesQuery, |
||||
GetHackerNewsTopStoriesQueryVariables |
||||
> |
||||
> |
||||
> { |
||||
render() { |
||||
return ( |
||||
<ReactApollo.Query< |
||||
GetHackerNewsTopStoriesQuery, |
||||
GetHackerNewsTopStoriesQueryVariables |
||||
> |
||||
query={GetHackerNewsTopStoriesDocument} |
||||
{...(this as any)["props"] as any} |
||||
/> |
||||
); |
||||
} |
||||
} |
||||
export type GetHackerNewsTopStoriesProps<TChildProps = {}> = Partial< |
||||
ReactApollo.DataProps< |
||||
GetHackerNewsTopStoriesQuery, |
||||
GetHackerNewsTopStoriesQueryVariables |
||||
> |
||||
> & |
||||
TChildProps; |
||||
export function withGetHackerNewsTopStories<TProps, TChildProps = {}>( |
||||
operationOptions: |
||||
| ReactApollo.OperationOption< |
||||
TProps, |
||||
GetHackerNewsTopStoriesQuery, |
||||
GetHackerNewsTopStoriesQueryVariables, |
||||
GetHackerNewsTopStoriesProps<TChildProps> |
||||
> |
||||
| undefined |
||||
) { |
||||
return ReactApollo.withQuery< |
||||
TProps, |
||||
GetHackerNewsTopStoriesQuery, |
||||
GetHackerNewsTopStoriesQueryVariables, |
||||
GetHackerNewsTopStoriesProps<TChildProps> |
||||
>(GetHackerNewsTopStoriesDocument, operationOptions); |
||||
} |
||||
|
Loading…
Reference in new issue