Skip to content

Instantly share code, notes, and snippets.

@unicodeveloper
Created September 19, 2018 13:26
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/4663749258650303c46b787f1cd96868 to your computer and use it in GitHub Desktop.
Save unicodeveloper/4663749258650303c46b787f1cd96868 to your computer and use it in GitHub Desktop.
const GetPosts = () => (
<Query query={GET_POSTS}>
{({ loading, error, data }) => {
if (loading) return "Loading...";
if (error) return "Error";
return (
<div>
{data.posts.map(post => (
<p key={post.id}> { post.title } </p>
))}
</div>
);
}}
</Query>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment