dsoraluz
06/04/2018, 2:40 PMUnhandled GraphQL subscription error TypeError: this.subscriptionClient.request is not a function
The prop that is being used to make the subscription call has been wrapped in the graphql container:
this.subscribeToAgents(fetchInitialData);
.
.
.
subscribeToAgents = fetchInitialData => {
fetchInitialData.subscribeToMore({
document: gql`
subscription{
Agent{
mutation
node {
id
name
status
}
}
}
`;,
updateQuery: (previous, { subscriptionData } ) => {
const { updateAgent } = this.props;
updateAgent(subscriptionData.Agent.node);
},
});
};
.
.
.
graphql(FetchInitialData, {
name: 'fetchInitialData',
options: ({ contentStore: { start, end } }) => ({ variables: { start, end } }),
}),
Note: the Apollo Client has been created to use a hybrid link that uses the split function just like the docs lay out and http requests are completed fine when made.