Created
September 12, 2018 14:42
-
-
Save unicodeveloper/8c4ec7c90189b3ceeaebb68264a4137c 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 FirstQuery = gql` | |
query One { | |
one | |
} | |
`; | |
const SecondQuery = gql` | |
query Two { | |
two | |
} | |
`; | |
const NumbersWithData = () => ( | |
<Query query={FirstQuery}> | |
{({ loading: loadingOne, data: { one } }) => ( | |
<Query query={SecondQuery}> | |
{({ loading: loadingTwo, data: { two }}) => { | |
if (loadingOne || loadingTwo) return <span>loading...</span> | |
return <h3>{one} is less than {two}</h3> | |
}} | |
</Query> | |
)} | |
</Query> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment