Created
September 12, 2020 07:55
-
-
Save betocmn/fe6d04eb57a7512cd1bfd51fcbcb0905 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
export const QUERY = gql` | |
query USERS { | |
users { | |
id | |
name | |
} | |
} | |
` | |
export const Loading = () => <div>Loading users...</div> | |
export const Empty = () => <div>No users yet!</div> | |
export const Failure = ({ message }) => <div>Error: {message}</div> | |
export const Success = ({ users }) => { | |
return ( | |
<ul> | |
{ users.map(user => ( | |
<li>{user.id} | {user.name}</li> | |
))} | |
</ul> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment