Last active
September 20, 2018 14:33
-
-
Save unicodeveloper/ae599427452f7bb4968c4c33d8cc1148 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
export const GetAndShowData = ({ userId }) => ( | |
<Query query={GET_USER} variables={{ userId }}> | |
{({ loading, data: { email } }) => ( | |
<Query query={GET_HACKERNEWS_STARTUP} variables={{ email }}> | |
{({ loading, data: { startup } }) => ( | |
<Query query={GET_REPO} variables = {{ startup }}> | |
{({loading, error, data: { correspondingRepo } }) => { | |
if (loading) return <p>Loading...</p>; | |
if (error) return <p>Error...</p>; | |
return ( | |
<div> | |
<p> corresponding Repo for { email } and { startup } : { correspondingRepo } </p> | |
</div> | |
); | |
}} | |
</Query> | |
)} | |
</Query> | |
)} | |
</Query> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment