import { ChildProps } from "react-apollo"; const withCharacter = graphql(HERO_QUERY, { options: ({ episode }) => ({ variables: { episode } }) }); class Character extends React.Component, {}> { render(){ const { loading, hero, error } = this.props.data; if (loading) return
Loading
; if (error) return

ERROR

; return ...// actual component with data; } } export default withCharacter(Character);