Moving comment id into query.

This commit is contained in:
David Jay
2017-02-28 12:02:51 -05:00
parent ab16e5bfe7
commit bf23fc2974
4 changed files with 35 additions and 7 deletions
@@ -0,0 +1,13 @@
#import "../fragments/commentView.graphql"
query commentQuery($id: ID!) {
comment(id: $id) {
...commentView
parent {
...commentView
replies {
...commentView
}
}
}
}
@@ -2,6 +2,7 @@ import {graphql} from 'react-apollo';
import STREAM_QUERY from './streamQuery.graphql';
import LOAD_MORE from './loadMore.graphql';
import GET_COUNTS from './getCounts.graphql';
import COMMENT_QUERY from './commentQuery.graphql';
import MY_COMMENT_HISTORY from './myCommentHistory.graphql';
function getQueryVariable(variable) {
@@ -97,4 +98,12 @@ export const queryStream = graphql(STREAM_QUERY, {
})
});
export const commentQuery = graphql(COMMENT_QUERY, {
options: () => ({
variables: {
id: getQueryVariable('comment_id')
}
})
});
export const myCommentHistory = graphql(MY_COMMENT_HISTORY, {});