Skip to content

Instantly share code, notes, and snippets.

@unicodeveloper
Created September 12, 2018 14:42
Show Gist options
  • Save unicodeveloper/8c4ec7c90189b3ceeaebb68264a4137c to your computer and use it in GitHub Desktop.
Save unicodeveloper/8c4ec7c90189b3ceeaebb68264a4137c to your computer and use it in GitHub Desktop.
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