From the commits it would appear that subscriptions is available in react-apollo now, correct?
Assuming this is true, it would be great to get the docs updated to explain this exciting feature.
Thanks!
Yep! We're doing that as part of releasing 0.5, which has much better ways of using subscriptions than before.
For the record, I don't believe subscriptions currently work w/ RA (unless it was fixed in one of the recent versions). The code is there but there is a bug that stops it working right now.
@tmeasday they do! I added it a few releases back!
@jbaxleyiii I tried using them sometime last week and there was some problem, maybe it had snuck in with some other changes in the last couple of releases?
I'll investigate further today rather than just throwing aspersions in an issue ;)
OK, I think I was talking total jive, I apologise. Not sure what the problem I ran into last week was, but this seems to work just fine now.
Hi guys. I want to ask a question about subscriptions.
The code at https://github.com/apollostack/GitHunt-React/blob/master/ui/routes/CommentsPage.js#L273 suggests that: there's a field named subscribeToMore in props. But I can't find it in the documentation
The code below always gives me subscribeToMore = undefined
import React, { Component } from 'react';
import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
class PostList extends Component {
// blah blah blah
}
export default graphql(gql `
query{
posts {
id
title
votes
author {
id
firstName
lastName
}
}
}`,
{
props: ({ data: { loading, posts, subscribeToMore } }) => {
console.log(subscribeToMore) // *** print `undefined`
return ({
loading, posts
})
}
}
)(PostList);
Would you please tell me what wrong is?
Hey @anhldbk - are you using the latest react-apollo and apollo-client?
Here is the issue about subscriptions I was talking about: https://github.com/apollostack/react-apollo/issues/319
We can't really document it until it works properly but I'll leave this open in any case.
closing as subscription docs have been improved! http://dev.apollodata.com/react/subscriptions.html
Most helpful comment
closing as subscription docs have been improved! http://dev.apollodata.com/react/subscriptions.html