Skip to content

Instantly share code, notes, and snippets.

@jbaxleyiii
Created June 4, 2017 04:08
Show Gist options
  • Save jbaxleyiii/7a9d3d5abe2a0654fca8b224d3797f2c to your computer and use it in GitHub Desktop.
Save jbaxleyiii/7a9d3d5abe2a0654fca8b224d3797f2c to your computer and use it in GitHub Desktop.
+ import type { OperationComponent, QueryProps } from "react-apollo";
- import type { OperationComponent } from "react-apollo";
+ export type Props = Response & QueryProps;
+ export const withCharacter: OperationComponent<Response, InputProps, Props> = graphql(HERO_QUERY, {
- export const withCharacter: OperationComponent<Response, InputProps> = graphql(HERO_QUERY, {
options: ({ episode }) => ({
variables: { episode },
}),
+ props: ({ data }) => ({ ...data }),
});
+ export default withCharacter(({ loading, hero, error }) => {
- export default withCharacter(({ data: { loading, hero, error } }) => {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment