mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Moving comment id into query.
This commit is contained in:
@@ -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, {});
|
||||
|
||||
Reference in New Issue
Block a user