aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/ListPage.js
diff options
context:
space:
mode:
authorQuentin Gliech <quentingliech@gmail.com>2018-07-31 00:18:55 +0200
committerQuentin Gliech <quentingliech@gmail.com>2018-07-31 00:18:55 +0200
commit8a4e373e7b1c093abeb967d9a6a43c5ed533edb8 (patch)
tree48d61c44e59a690d73e55b5fca288ef94b1d3569 /webui/src/ListPage.js
parent091ac03f1f758bd681c5f522b88c04ea04d81359 (diff)
downloadgit-bug-8a4e373e7b1c093abeb967d9a6a43c5ed533edb8.tar.gz
webui: Use the new schema
Diffstat (limited to 'webui/src/ListPage.js')
-rw-r--r--webui/src/ListPage.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/webui/src/ListPage.js b/webui/src/ListPage.js
index c873eefa..836acda5 100644
--- a/webui/src/ListPage.js
+++ b/webui/src/ListPage.js
@@ -9,8 +9,15 @@ import BugSummary from "./BugSummary";
const QUERY = gql`
{
- bugs: allBugs {
- ...BugSummary
+ defaultRepository {
+ bugs: allBugs(input: { first: 10 }) {
+ edges {
+ cursor
+ node {
+ ...BugSummary
+ }
+ }
+ }
}
}
@@ -27,8 +34,8 @@ const styles = theme => ({
const List = withStyles(styles)(({ bugs, classes }) => (
<main className={classes.main}>
- {bugs.map(bug => (
- <BugSummary bug={bug} key={bug.id} />
+ {bugs.edges.map(({ cursor, node }) => (
+ <BugSummary bug={node} key={cursor} />
))}
</main>
));
@@ -38,7 +45,7 @@ const ListPage = () => (
{({ loading, error, data }) => {
if (loading) return <CircularProgress />;
if (error) return <p>Error.</p>;
- return <List bugs={data.bugs} />;
+ return <List bugs={data.defaultRepository.bugs} />;
}}
</Query>
);