an end to end journey with Node.js and React
Kadi Kraman
Software Engineer
http://graphql.org/
GET /movies/1
{
"title": "The Greatest Showman",
"director": {
"firstName": "Michael",
"lastName": "Gracey"
}
// ... more fields
}
GET /movies/1
{
"title": "The Greatest Showman",
"directorId": 1
// ... more fields
}
GET /directors/1
{
"firstName": "Michael",
"lastName": "Gracey"
// ... more fields
}
GET /graphql?query={ movie(id: "1") { title, author { firstName } } }
{
"title": "The Greatest Showman",
"director": {
"firstName": "Michael"
}
}
"Hello World" Express Server
Describe your data
Resolve your data
Add the /graphql endpoint
Query your API
Add a /graphiql endpoint
yarn global add create-react-app
create-react-app my-app
cd my-app
yarn start
1. Refactor the greeting out of the root component
2. Wrap the app in ApolloClient
Wrap the app in ApolloClient
3. Refactor greeting to fetch data from the API
Decorate Greeting with the required data
Apollo 1: Redux Store
Apollo 2: In Memory Cache
Honorable Mention
https://github.com/apollographql/apollo-link-rest
Honorable Mention
https://github.com/FormidableLabs/gql-workshop-app/
https://github.com/FormidableLabs/gql-workshop-app/tree/final-version
https://github.com/FormidableLabs/gql-workshop-app
http://graphql.org/learn/
https://www.apollographql.com/docs/apollo-server/
https://www.apollographql.com/docs/react/
@kadikraman