Spring Boot GraphQL Tutorial: Simplify Your API with Query by Example

preview_player
Показать описание
🚀 Learn how to build a flexible GraphQL API in Spring Boot using Query by Example (QBE)! This tutorial shows you how to eliminate boilerplate code and create dynamic queries without writing endless repository methods.

In this hands-on tutorial, we'll build a complete book management API from scratch using Spring Boot, GraphQL, and Query by Example. You'll learn how to create a flexible search API that can handle multiple search parameters without writing complex query methods.
What You'll Learn:

✅ Set up a Spring Boot project with GraphQL and JPA
✅ Use the @GraphQLRepository annotation for automatic query mapping
✅ Implement Query by Example for flexible searching
✅ Create a dynamic GraphQL API without writing boilerplate code
✅ Test your API using the GraphQL playground

📹 Video Chapters:
00:00 - Introduction
02:15 - Project Setup
04:30 - Creating the Schema
07:45 - Implementing the Entity
10:30 - Repository Configuration
13:15 - Testing the API
16:45 - Final Thoughts

Related Videos:

👋🏻Connect with me:

Рекомендации по теме
Комментарии
Автор

at 13:00, is calling many save() methods will result in a single batch execution?

CodeJava
Автор

Hi, thank you for the great video. I am also studying the spring boot ? Do u have any book or course you think would be helpful ? Thank you.

renyuliu
Автор

Thank you Dan! One question came to my mind: Why exactly does our repository interface extend QueryByExampleExecutor? If I am not mistaken, all GraphQL queries you executed work without it, too.

amsfuy
Автор

Awesome tutorial! I'm just diving into GraphQL myself. If the GUI is more for testing/development purposes, how would this application (specifically these queries) work in production?

xCaleb
Автор

Hello Dan, thank you for your great content. I've been learning Spring and Spring Security and I've watched a lot of tutorials and none of them explain this: Most of the applications nowadays allow us to Login using OAuth or using basic login credentials, but if i login for the first time using OAuth, and underlying account is created. I would love a video that exemplifies this whole Authentication and Authorization process. Using OAuth or Login for having an account on the application and using Jwt for both of them uppon creation. How are these integrated together in a Rest API?

tomascorreialc
Автор

Hi Dan,
Thank you for the excellent tutorial! I have a quick question: When we start the application, the Postgres container is launched automatically. Is this due to the DataLoader? How does the application recognize the Docker Compose file and initiate the container?

hennessynguyen
Автор

@Dan, the query that gets generated are still the same no matter how many fields and child-fields i specify on the request query. Is there a way to make the query dynamic so that it would fetch only the selected columns or child table rows(cols)?

ut
Автор

Have any ideas for an elegant way to hook in Matchers that can be specified in the GraphQL query with QBE? What if I wanted to query for books published after 2020 ?

JonathanStein