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 - 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…
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.
Contents
-
-
-
-
(Locked)
Setting up the project4m 18s
-
(Locked)
Creating the schema4m 5s
-
(Locked)
Creating a Spring Data repository5m 41s
-
(Locked)
Creating the GraphQL controller6m 44s
-
(Locked)
Mutations5m 32s
-
(Locked)
Errors4m 8s
-
(Locked)
Challenge: Extending the API1m 19s
-
(Locked)
Solution: Extending the API4m 4s
-
(Locked)
-