import { Query } from 'react-apollo'; import PropTypes from 'prop-types'; import { SINGLE_ITEM_QUERY } from '../queries/index'; const SingleItem = props => ( {({ data: { items }, loading, error }) => { if (loading || error) return null; const [item] = items; return (
{item.title}

Viewing {item.title}

{item.description}

); }}
); SingleItem.propTypes = { id: PropTypes.string.isRequired, }; export default SingleItem;