Skip to content

Instantly share code, notes, and snippets.

@kamilkisiela
Last active October 30, 2018 09:25
Show Gist options
  • Save kamilkisiela/38e1df0dd8aa9ece142a9f6ddd1b2292 to your computer and use it in GitHub Desktop.
Save kamilkisiela/38e1df0dd8aa9ece142a9f6ddd1b2292 to your computer and use it in GitHub Desktop.
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