Created
October 4, 2021 08:40
-
-
Save hackintoshrao/f313ff1f48dea6fed228778455b93962 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
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