Root Data Connect
Next thing to do is add the root data connector. This is responsible for collecting all data connectors’ requests and bundle them to make a single request with GraphQL. This passes down a fetchData
function through context, so it should be inserted into the entry component of your App. Here’s how to:
With ES7 decorator
1 | import React, {Component} from 'react'; |
With ES6
1 | import React, {Component} from 'react'; |
Your App is now ready to collect data requirements and request them in a single request. Nice! In the next page let’s see how to declare those data requirements with fragments.