Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Created December 17, 2018 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianhall/403b04cc5e139d235d084b2883b077d9 to your computer and use it in GitHub Desktop.
Save adrianhall/403b04cc5e139d235d084b2883b077d9 to your computer and use it in GitHub Desktop.
const UserBlockFunction = () => {
return (
<Connect query={graphqlOperation('{ me { id name } }')}>
{(response) => {
if (response.loading) {
return (<LoadingIndicator loading={response.loading}/>);
} else if (response.data && response.data.me) {
return (<UserBlock name={response.data.me.name}/>);
} else {
return (<ErrorIndicator errors={response.errors}/>);
}
}}
</Connect>
);
};
export default UserBlockFunction;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment