Adding hasParent on Comment to the Graph

This commit is contained in:
Belen Curcio
2017-08-21 16:21:39 -03:00
parent 8b044954d9
commit a540dfe8d4
4 changed files with 8 additions and 1 deletions
@@ -69,7 +69,7 @@ class Comment extends React.Component {
let selectionStateCSS = selected ? 'mdl-shadow--16dp' : 'mdl-shadow--2dp';
const queryData = {root, comment, asset: comment.asset};
console.log(comment);
return (
<li
tabIndex={0}
@@ -53,6 +53,7 @@ export default withFragments({
editing {
edited
}
hasParent
${getSlotFragmentSpreads(slots, 'comment')}
}
`
+3
View File
@@ -1,6 +1,9 @@
const {decorateWithTags} = require('./util');
const Comment = {
hasParent({parent_id}) {
return !!parent_id;
},
parent({parent_id}, _, {loaders: {Comments}}) {
if (parent_id == null) {
return null;
+3
View File
@@ -339,6 +339,9 @@ type Comment {
# describes how the comment can be edited
editing: EditInfo
# Indicates if it has a parent
hasParent: Boolean
}
# CommentConnection represents a paginable subset of a comment list.