atempt to solution

This commit is contained in:
Belen Curcio
2017-01-20 18:53:11 -03:00
parent f813a77194
commit b98b71189f
3 changed files with 20 additions and 23 deletions
+2 -2
View File
@@ -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}}
});