Advanced React - Wes Bos Flashcards
What is the purpose of Next.js?
It lets us do server-side rendering of our app and provides a way to do pages, routing, and overall layout of the app.
What do you need to do to set up Next.js?
You don’t have to write any custom routing, it just figures it out, but you do have to do a little config.
What is Apollo used for?
To manage interacting with our data on the client.
What does Apollo replace, effectively?
Both React State and Redux.
Besides managing our state, what does Apollo do?
It helps us perform GraphQL mutations, fetch data, and is has lightning fast caching built in to it.
What does it mean to say Apollo has caching built-in?
The data is stored in the cache, so it becomes instant to go back and forth between pages after the first time.
Can Apollo manage local state?
Yep.
Which states does Apollo provide?
Both error and loading states - it takes care of catching errors and nicely providing them to us.
What is Prisma?
It provides an interface layer on top of your database for all CRUD operations.
With Prisma, do you interface directly with the MySQL database?
No - it’s a layer on top of the database.
How does Prisma work?
Almost all GraphQL APIs are the same for CRUD operations, so Prisma provides a comprehensive API so that we can provide what our data looks like, then it ingests that, and provides us an API we can use on top of the data.
How is Prisma hosted?
It can either be self-hosted or used as a service.
Does Prisma provide a logic layer (to do stuff when saving, or updating, deleting, or viewing)?
No - if you want to introduce logic before or after data operations, you’ll need something else (like GraphQL Yoga)
What is GraphQL Yoga used for?
It’s used for additional logic - say, sending an email after a record is created, or resizing an image before saving it.