1. Introducing Apollo Connectors
3m

The challenge of many APIs

APIs power the apps we use, and the services we rely on every day. From planning trips to ordering groceries online, APIs are the magic behind the scenes that make it all happen.

But let's be honest: orchestrating all those API calls can get pretty challenging, especially as your architecture grows.

Chances are, your apps have hundreds of lines of code to handle : you might need to sequence API calls from a bunch of different sources, or wait on one response before having to pipe a piece over to another request or have to navigate through and transform complex, nested data structures. Keeping that code organized and maintainable as your system scales can quickly become messy.

Messy client API orchestration

Or, if you're already using , you're dealing with building . That means picking a framework, learning how to use it, and writing functions to connect to your data sources. It takes a bit of time, and it can feel overwhelming.

GraphQL Federation

Either way, organizing and managing API calls efficiently is a constant challenge in app development. But it doesn't have to be!

Introducing Apollo Connectors

Apollo Connectors transform the way we connect to REST APIs, simplifying in a declarative, configuration-first approach.

We do all of our work inside a schema: a collection of types and that build the comprehensive picture of everything we can do with our API. With , we define requests to our data sources and map the responses to our schema. We get to pick the exact fields we need and shape the data just the way we want it. No more complex data-fetching code; just clean, declarative queries that anyone on our team can understand.

Connectors schema

And if you're already using federation, connectors build on top of what you already know. Whenever you need to bring a REST API into your , you can skip those time-intensive steps of building a .

In this course, we'll cover the basics of , including how to set up our schema and the that make it all work. We'll also explore tools like the to run our API and to send and debug our connector calls.

Learner pre-requisites

We assume that you're familiar with the basics of a and how to send GraphQL . Check out graphql.com/learn if you need a refresher. You don't need to know any particular programming language for this course.

Practice

Which of the following are benefits of using Apollo Connectors?

Key takeaways

  • provide a declarative, configuration-first approach for simplifying .
  • With , we define requests to our data sources and map the responses to our schema.

Up next

Ready? Let's set up the project we'll be working with, a space travel booking API, so we can get hands-on with !

Next

Share your questions and comments about this lesson

Your feedback helps us improve! If you're stuck or confused, let us know and we'll help you out. All comments are public and must follow the Apollo Code of Conduct. Note that comments that have been resolved or addressed may be removed.

You'll need a GitHub account to post below. Don't have one? Post in our Odyssey forum instead.