From the course: Learning GraphQL
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Querying connected types - GraphQL Tutorial
From the course: Learning GraphQL
Querying connected types
- [Instructor] We've gotten a lot of information about a single type, but part of the power of GraphQL is being able to make connections between different data types. So, let me show you what I mean. If we go over here to our alllifts query, there's another one of these fields called trailAccess. So, this is going to tell me based on the lift that I'm on, so I can ride a lift up to the top of the mountain, and then I can take a trail down, so this is going to let me know how to do that. I also want to get rid of our status argument here if I got rid of the query, and now we can see that there's a trailAccess field. This returns an array of objects. All of these objects have all of the fields that are related to the trail. For more on what that trail type is, you can always come over to the Documentation panel. You can select trailAccess, but you also can search the docs. So, if you're like, "There's probably a trail in here somewhere", you can click on Trail, and that's going to tell…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.