Last active
October 30, 2018 09:25
-
-
Save kamilkisiela/38e1df0dd8aa9ece142a9f6ddd1b2292 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import React from 'react'; | |
import { Query } from '@loona/react'; | |
import { List } from '../common/List'; | |
const ALL_BOOKS = gql` | |
query GetAllBooks { | |
books @client { | |
id | |
title | |
} | |
} | |
`; | |
export function BooksList() { | |
return ( | |
<Query query={ALL_BOOKS}> | |
{({ data, loading }) => { | |
if (loading) return '...'; | |
return <List list={data.books} />; | |
}} | |
</Query> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment