mirror of
https://github.com/wassname/talk.git
synced 2026-07-10 01:40:39 +08:00
atempt to solution
This commit is contained in:
@@ -219,6 +219,6 @@ let url = pym.parentUrl;
|
||||
|
||||
export default compose(
|
||||
connect(mapStateToProps, mapDispatchToProps),
|
||||
postComment(),
|
||||
queryStream()
|
||||
postComment,
|
||||
queryStream
|
||||
)(Embed);
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
import { graphql } from 'react-apollo';
|
||||
import POST_COMMENT from './postComment.graphql';
|
||||
|
||||
export const postComment = () =>
|
||||
graphql(POST_COMMENT, {
|
||||
props: ({mutate}) => ({
|
||||
postItem: ({asset_id, body}) => {
|
||||
mutate({
|
||||
variables: {
|
||||
asset_id,
|
||||
body,
|
||||
parent_id: null
|
||||
}
|
||||
}).then(({data}) => {
|
||||
console.log('it workt');
|
||||
console.log(data);
|
||||
});
|
||||
}}),
|
||||
});
|
||||
export const postComment = graphql(POST_COMMENT, {
|
||||
props: ({dispatch, mutate}) => ({
|
||||
postItem: ({asset_id, body}) => {
|
||||
mutate({
|
||||
variables: {
|
||||
asset_id,
|
||||
body,
|
||||
parent_id: null
|
||||
}
|
||||
}).then(({data}) => {
|
||||
console.log('it workt');
|
||||
console.log(data);
|
||||
});
|
||||
}}),
|
||||
});
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ import Pym from 'pym.js';
|
||||
const pym = new Pym.Child({polling: 100});
|
||||
let url = pym.parentUrl;
|
||||
|
||||
export const queryStream = () =>
|
||||
graphql(STREAM_QUERY, {
|
||||
options: {variables: {asset_url: url}},
|
||||
props: props => props,
|
||||
});
|
||||
export const queryStream = graphql(STREAM_QUERY, {
|
||||
options: {variables: {asset_url: url}}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user