Created
December 17, 2018 23:16
-
-
Save adrianhall/403b04cc5e139d235d084b2883b077d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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