Skip to content

Instantly share code, notes, and snippets.

@redbluenat
Last active December 11, 2018 11:02
Show Gist options
  • Save redbluenat/ec0fe1f32f378fcf2222b7373c035af3 to your computer and use it in GitHub Desktop.
Save redbluenat/ec0fe1f32f378fcf2222b7373c035af3 to your computer and use it in GitHub Desktop.
const DogComponent = graphql(dogQuery)(props => {
const { error, dogs } = props.data;
if (error) {
return <Text>{error}</Text>;
}
if (dogs) {
return <Text>{dogs[0].name}</Text>;
}
return <Text>Loading...</Text>;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment