Тёмный

Apollo's Data Sources: Elevate Your GraphQL Server 

Ljupche Vasilev
Подписаться 864
Просмотров 209
50% 1

Hey GraphQL enthusiasts! 🚀 In today's tutorial, we're taking our GraphQL server to the next level by diving into Apollo's Data Sources classes. Join me as we explore how these classes revolutionize data management and enhance the overall efficiency of your GraphQL operations.
📜 Timestamps:
0:00 What we will build
0:07 What are Data Sources?
0:40 When to Use Them and Why
1:10 Live Code Example
2:30 RESTDataSource
6:25 SQLDataSource
9:49 Outro
🌟 [What We Will Build]
In a few simple changes, we've upgraded our GraphQL server by incorporating Apollo's recommended data source classes. It's a game-changer, and I'm excited to show you how!
📚 [What are Data Sources?]
Apollo's Data Sources classes, including HTTPDataSource, SQLDataSource, MongoDataSource, and more, are designed to supercharge your data management game. These classes handle caching, deduplication, and errors, making your life as a developer much easier. While you're not obliged to use them, Apollo strongly encourages it, and for good reason - they handle a ton of complex stuff for you!
🤔 [When to Use Them and Why]
Each data source class serves specific use cases. Need to fetch data from REST API microservices? Say hello to HTTPDataSource. Working with MongoDB? Enter MongoDataSource. These classes are tailor-made to streamline data management, and we'll explore exactly when and why to leverage them.
🚀 [Example]
Let's put theory into practice! We'll revisit our REST API example, previously used for chain resolvers, and seamlessly migrate fetch requests to HTTPDataSource. Next up, we'll delve into an SQL example using SpaceX data, showcasing how to fetch data from an SQL database and make the shift to SQLDataSource.
1️⃣ REST API: Migrating to HTTPDataSource
2️⃣ SQL: Fetching Data from SQL Database Using SQLDataSource
💡 [Features]
These classes aren't just rigid tools - they're flexible for your unique use cases. We'll explore how to modify them, like overriding a willSendRequest function to add tokens or perform other operations. Plus, Apollo encourages you to create your own data source classes by extending the abstract data source class they provide.
👩‍💻 [Outro]
And that's a wrap for this video! I hope you enjoyed the journey into Apollo's Data Sources, gaining valuable insights and skills. If you have thoughts, questions, or future tutorial requests, drop them in the comments.
🔗 Helpful Links:
Apollo Data Sources: www.apollographql.com/docs/ap...
Apollo V4 Fetching Data: www.apollographql.com/docs/ap...
RESTDataSource: github.com/apollographql/data...
SQLDataSource: github.com/cvburgess/SQLDataS...
Project repo: github.com/LjupcheVasilev/apo...
Until next time, happy coding! 🚀👩‍💻👨‍💻
Background song by:
/ dahjp

Опубликовано:

 

16 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 2   
@acesvaba330
@acesvaba330 6 месяцев назад
Awesome, thank you big time!
@LjupcheVasilev
@LjupcheVasilev 5 месяцев назад
Glad it helped!
Далее
GraphQL N+1 Problem
16:14
Просмотров 108 тыс.
REST to GraphQL: From Endpoints to Capabilities
21:06
Просмотров 1,5 тыс.
Вопрос Ребром: Сергей Бурунов 2
1:03:47
Software Architecture From 0 To Enterprise
13:31
Просмотров 1,1 тыс.
Common Mistakes and Advanced Typescript Techniques
10:49
Building a GraphQL API using SpaceX Data
15:43
I've been using Redis wrong this whole time...
20:53
Просмотров 337 тыс.
The Easiest Way To Manage Database Migrations in .NET
11:40
Batching GraphQL Requests with DataLoader
6:44
Просмотров 11 тыс.
When RESTful architecture isn't enough...
21:02
Просмотров 247 тыс.