We will start by implementing the Query component. You should be able to easily follow the instructions here, as all of the patterns and React basics should be clear by now:
- Create a new queries folder inside of the components folder, as follows:
mkdir src/client/components/queries
- The query that we want to remove from our view layer is the postsFeed query. You can define the naming conventions for this, but I would recommend using the RootQuery name as the filename, as long as it works. So, we should create a postsFeed.js file in the queries folder, and insert the following code:
export default class PostsFeedQuery extends Component { getVariables() { const { variables } = this.props; var query_variables = ...