2016-11-11 16:42:19 +09:00
|
|
|
import Telescope from 'meteor/nova:lib';
|
|
|
|
import React, { PropTypes, Component } from 'react';
|
|
|
|
import Posts from "meteor/nova:posts";
|
|
|
|
import { graphql } from 'react-apollo';
|
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
2016-11-11 18:25:47 +09:00
|
|
|
export default function withPostsSingle (component, options) {
|
2016-11-11 16:42:19 +09:00
|
|
|
return graphql(gql`
|
|
|
|
query getPost($postId: String) {
|
|
|
|
post(_id: $postId) {
|
|
|
|
${Posts.graphQLQueries.single}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`, {
|
|
|
|
options(ownProps) {
|
|
|
|
return {
|
2016-11-11 18:19:18 +09:00
|
|
|
variables: { postId: ownProps.postId },
|
2016-11-11 16:42:19 +09:00
|
|
|
// pollInterval: 20000,
|
|
|
|
};
|
|
|
|
},
|
2016-11-11 18:25:47 +09:00
|
|
|
})(component);
|
2016-11-11 16:42:19 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = withPostsSingle;
|