From the course: Spring with GraphQL
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Creating a Spring Data repository - Spring Tutorial
From the course: Spring with GraphQL
Creating a Spring Data repository
- [Instructor] Now you can back a GraphQL service with any data source. You could call REST services. And it's something that I encourage you to do, which is use Spring RestTemplate as a data source so that you can expose a GraphQL layer for your microservices architecture. But in this case, we're going to go directly to the database. So we're going to use Spring Data to be our data provider using a built-in in-memory database. Obviously, in the real world, you would back this with a real database. But for now, for demo purposes, the embedded database works great. So let's jump into our IDE. So the first thing that I want you to do is I want you to open up source, main, resources. And I want you to copy from the data directory that I provided in the exercise files the data dot sql and the schema dot sql. And I want you to paste those right into resources. Now, what this allows it to do is that the schema dot sql will…
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)
-