Skip to content

Instantly share code, notes, and snippets.

@betocmn
Created September 12, 2020 07:55
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 betocmn/fe6d04eb57a7512cd1bfd51fcbcb0905 to your computer and use it in GitHub Desktop.
Save betocmn/fe6d04eb57a7512cd1bfd51fcbcb0905 to your computer and use it in GitHub Desktop.
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