From the course: Spring with GraphQL

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Solution: Extending the API

Solution: Extending the API - Spring Tutorial

From the course: Spring with GraphQL

Solution: Extending the API

(upbeat music) - [Instructor] So now it's time for my solution to this exercise of extending the API. Let's start in the IDE. And I made a lot of changes cause I went ahead and implemented the entire graph. We'll start specifically with the schema file. You'll see if we go towards the top I added a type for salesperson, a type for product, a type for an order, and a type for order line. And I included the order lines on the order, which means I'm going to have some one-to-many and many-to-one relationships, because order and order line both have entities as part of the definition. So let's take a look at how I did the order itself. So the order itself, we have some very simple elements on the entity. We've got the order ID, which as you would expect is the ID. But then we have a many-to-one relationship with customer. This allows us to load the customer data from the order itself. We also have salesperson in the same…

Contents