Visão Geral
Este curso ensina, na prática, como consumir APIs REST e GraphQL dentro de aplicações React de forma organizada, eficiente e escalável. Você aprenderá desde requisições simples até estratégias modernas de cache, paginação, filtros, autenticação e integração com back-ends reais.
Conteúdo Programatico
Module 1 – Fundamentals of API Consumption
- What is an API
- REST vs GraphQL basics
- HTTP methods and status codes
- JSON parsing and common pitfalls
Module 2 – Consuming REST APIs in React
- Fetch API and async/await
- Handling loading and error states
- Consuming endpoints with query params
- POST, PUT, DELETE requests
- Organizing fetch functions
Module 3 – Using Axios for REST
- Setting up Axios
- Interceptors for auth and errors
- Creating API services
- Best folder structure for data layers
Module 4 – Intro to GraphQL
- Queries vs mutations
- GraphQL schemas and resolvers (overview)
- How GraphQL differs from REST
- When to choose GraphQL
Module 5 – React + GraphQL with Apollo Client
- Setting up Apollo Provider
- Running queries and mutations
- Cache normalization
- Refetching and pagination
- Error handling
Module 6 – React + GraphQL with URQL
- URQL basics
- Queries, mutations and subscriptions
- Lightweight GraphQL architecture
- Choosing between Apollo and URQL
Module 7 – Advanced Data Management
- Pagination strategies (cursor, offset)
- Debouncing search queries
- Optimistic UI updates
- Managing request cancellation
- Revalidation strategies
Module 8 – Authentication & Secure Requests
- Token-based authentication
- Refresh tokens and silent refresh
- Securing API calls
- Protected routes in React
Module 9 – Final Project
- Full React application consuming:
- A REST API
- A GraphQL API
- Implementing pagination, filters, login and mutations
- Data layer organization and final optimizations