Moviewatch App typescript challenge, using React, Apollo and Typescript, You'll build an app to let you keep track of the movies you'd like to watch.
- Bring up the API and Database:
cd backend && npm install && docker-compose up
- Bring up the Frontend development server:
cd frontend && npm install && npm start
-
Begin by using the
useQuery
Apollo hook to make a new GraphQL query to retrieve all the movies, display the movies within theMovies
Screen component. You can place your query withinmodels/movies/queries.ts
Tip: Use the GraphQL Schema documentation at localhost:5000 to help construct your query
Tip: Writing a query
-
Now try converting the
Movies
component to Typescript! Head tofrontend/screens/Movies/index.js
and convert to a.tsx
Typescript component.Tip: Use the GraphQL Schema documentation at localhost:5000 to help write the interface for a movie!
-
Convert the
MovieCard
component to Typescript! Head tofrontend/screens/Movies/components/MovieCard.js
and convert to a.tsx
Typescript component. -
In the
Movies
component, create a mutation which adds a movie to your watch list when clicked. Don't forget to type your mutation!Tip: Use the schema documentation
-
Within the
WatchList
component write a query to retrieve all the movies in your watch list. You can use theWatchListItem
component to render the movies you're watching! -
Estimate your binge! Within the footer area of the WatchList component, create a new component that displays the total run time of all the films in your watch list.
-
You should now have a couple different queries/mutations in the
/models
directory, try runningcd frontend && npm run schema:update
to automatically generate Typescript interfaces for your queries and mutations. -
Refactor your components to remove your handwritten types and use the auto generated Typescript types instead.