December 2019
Intermediate to advanced
474 pages
10h 3m
English
The react-apollo package doesn't only export a Provider but also methods to consume the value from this Provider. That way, you can easily get any value using the client that was added to the Provider. One of those methods is Query, which helps you to send a document containing a query to the GraphQL server, without having to use a fetch function, for example.
Since a Query component should always be nested inside an ApolloProvider component, they can be placed in any component that's been rendered within App. One of those is the Products component in client/src/components/Product/Products.js. This component is being rendered for the / route and should display products that are available in the e-commerce ...