Referencing parent fields with $this - The Weekly Wisdom - Edition #9

:graduation_cap: Welcome to The Weekly Wisdom

:spiral_calendar: Edition #9 - 3 Jul 2025
:label: Topic tags - Connectors odyssey
:bell: Stay in the loop: Subscribe to the “The Weekly Wisdom” category to get notified when new posts drop—no FOMO here.


Hey all! :waving_hand: Michelle here from the Apollo Education team. I’m a Developer Educator and I build courses for Odyssey, our official learning platform.

I’m back for the next edition of a multi-part series to teach you the basics of Apollo Connectors: a powerful way to bring existing REST APIs into your graph, all through configuration in the schema.

:light_bulb:This week’s learning: Referencing parent fields with $this

When orchestrating multiple REST calls, it’s common to need values from the parent object to build your request. Apollo Connectors lets you do this elegantly using the $this variable..

Let’s say we’re building a schema for bookings, and each booking has a guest review that lives in a separate REST endpoint. We can use $this.id to grab the booking’s ID and pass it as a parameter in the Connector’s request:

type Booking {
  id: ID!
  guestReview: Review
    @connect(
      source: "listings"
      http: { GET: "/guestReview?bookingId={$this.id}" }
      selection: """
      id
      text
      rating
      """
    )
}

With just this bit of schema, we’ve orchestrated two REST calls: one to retrieve the booking, one for the related guest review, with no resolver code required!


:magnifying_glass_tilted_right: Want to go deeper?

You’ll find a full walkthrough in Lesson 8 of the Odyssey tutorial, where we put $this to work in real examples.

Take the course


:speech_balloon: Share your thoughts in the thread below :down_arrow:

Can you think of a REST endpoint in your app where $this would make orchestrating a related call easier?