Skip to content

Instantly share code, notes, and snippets.

@hackintoshrao
Created October 4, 2021 08:40
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 hackintoshrao/f313ff1f48dea6fed228778455b93962 to your computer and use it in GitHub Desktop.
Save hackintoshrao/f313ff1f48dea6fed228778455b93962 to your computer and use it in GitHub Desktop.
function DogPhoto({ breed }) {
const { loading, error, data } = useQuery(GET_DOG_PHOTO, {
variables: { breed },
});
if (loading) return null;
if (error) return `Error! ${error}`;
return (
<img src={data.dog.displayImage} style={{ height: 100, width: 100 }} />
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment