Skip to content

Instantly share code, notes, and snippets.

@unicodeveloper
Last active September 20, 2018 14:33
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 unicodeveloper/ae599427452f7bb4968c4c33d8cc1148 to your computer and use it in GitHub Desktop.
Save unicodeveloper/ae599427452f7bb4968c4c33d8cc1148 to your computer and use it in GitHub Desktop.
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