Skip to Main Content
React Projects
book

React Projects

by Roy Derks
December 2019
Intermediate to advanced content levelIntermediate to advanced
474 pages
10h 3m
English
Packt Publishing
Content preview from React Projects

Using mutations with subscriptions

Apart from using a subscription to receive messages in a conversation, they can also be used to display the messages you send yourself. Previously, you used the refetchQueries prop on a Mutation component to resend documents with any queries that would have been affected by the mutation you've executed. By using subscriptions, you no longer have to refetch, for example, the conversation query, as the subscription will get the new message you've just sent and add it to the query.

In the previous section, you used a Query component from react-apollo to send a document to the GraphQL server, while in this section, the new React Apollo Hooks will be used.

The React Apollo Hooks can be used from the react-apollo ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

React Projects - Second Edition

React Projects - Second Edition

Roy Derks
Test-Driven React

Test-Driven React

Trevor Burnham

Publisher Resources

ISBN: 9781789954937Supplemental Content