Creating a Twitter timeline with Apollo and GraphQL
Apollo is an open source infrastructure for GraphQL. There are other libraries for handling GraphQL, such as Relay and Universal React Query Library (URQL). The main problem with these libraries is that they are mainly for React applications, while Apollo can work with any other technology or framework.
Getting ready
For this recipe, we are going to create a new React application using create-react-app
:
create-react-app apollo
We need to eject the configuration by executing the following command:
npm run eject
The eject
command will bring all the configuration of react-scripts
to your local project (Webpack configuration).
Now we need to install the following packages:
npm install apollo-boost graphql graphql-tag moment mongoose react-
apollo
And we need to install these dev packages as well:
npm install --save-dev babel-preset-react babel-preset-stage-0
Then we need to add a resolutions
node to specify the exact version of GraphQL we are...