Skip to content

Instantly share code, notes, and snippets.

@jbaxleyiii
Created July 19, 2017 03:22
Show Gist options
  • Save jbaxleyiii/51a8c3fde6e74c619371831ac6ef3748 to your computer and use it in GitHub Desktop.
Save jbaxleyiii/51a8c3fde6e74c619371831ac6ef3748 to your computer and use it in GitHub Desktop.
export const withCharacter = graphql<Response, InputProps, Props>(HERO_QUERY, {
options: ({ episode }) => ({
variables: { episode },
}),
props: ({ data, ownProps }) => ({
...data,
// Operator '>' cannot be applied to types 'string' and 'number'.
episode: ownProps.episode > 1,
// Property 'isHero' does not exist on type 'Hero'.
isHero: data && data.hero && data.hero.isHero,
}),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment