Sorry, this page is no longer available
We may earn an affiliate commission when you visit our partners.
Course image
Santhosh Krishnan

This course is about using GraphQL Federation with Spring Boot 3 and Java 21, mastering the art of architecting scalable, distributed systems for modern applications.

Course Learning Objectives:

Read more

This course is about using GraphQL Federation with Spring Boot 3 and Java 21, mastering the art of architecting scalable, distributed systems for modern applications.

Course Learning Objectives:

  • Learn the fundamentals of GraphQL Federation and how it integrates with multiple GraphQL services.

  • Learn to implement  GraphQL APIs using Spring Boot 3 and Java.

  • Explore the Netflix Domain Graph Service (DGS) framework and its application in building scalable GraphQL APIs.

  • Master the setup and configuration of the Apollo Federation Gateway to connect multiple GraphQL services.

  • Gain hands-on experience with federated schemas, error handling, and request interceptors.

  • Learn to write effective GraphQL queries and GraphQL Mutations.

  • Learn to create GraphQL fragments and Aliases.

  • Learn to use GraphQL extended scalars libraries for Spring Boot for advanced data types.

  • Learn to write JUint testecases for your GraphQL queries and mutations using GraphQL tester interface.

  • By the end of this course, students will master the implementation of GraphQL Federation, Domain Graph Service (DGS), and Apollo Federation Gateway using Java and Spring Boot 3, equipping them with the skills to build and test efficient and scalable GraphQL APIs.

  • The Quick Start Guide provided in every chapter is an essential steps to help students get started with the course exercises, ensuring they have the necessary information to set up and run the applications smoothly. This includes detailed instructions on setting up projects, switching branches, and running the applications in an IDE. This guide ensures that students can focus on learning without getting bogged down by setup issues.

  • The Postman collection, attached to each chapter, is designed to help students run sample queries and mutations. By importing the provided Postman collection, students can easily test the GraphQL queries and mutations discussed in the course. This hands-on approach reinforces the learning and helps students understand the practical application of the concepts covered.

Enroll now

What's inside

Syllabus

In this chapter, we'll cover:


  • How to structure and execute GraphQL queries to fetch specific data fields.

  • Use of aliases in queries.

  • Creating reusable sets of fields with fragments to avoid repetition and query management.

  • Understanding the use of HTTP POST for sending GraphQL queries and mutations.

  • Using introspection queries to explore and troubleshoot issues.

Read more

In this episode, we'll cover:

  • The fundamentals of GraphQL and its advantages over REST for efficient and flexible data fetching.

  • The role and structure of schemas in defining GraphQL APIs and ensuring data consistency.

  • The advantages of schema evolution in GraphQL.

In this episode, we'll cover:

  • Learn to set up Spring Boot GraphQL project using JDK 21 and Spring Boot 3.0.

  • Familiarizing with the project layout and configuring the IDE for seamless development.

  • Running and verifying a basic Spring Boot GraphQL application, ensuring all dependencies are correctly resolved and integrated.

In this chapter, we'll cover:

  • Develop a basic Account Management System with entities such as Account, Client, and Currency, featuring functionalities to list accounts.

  • Create a GraphQL schema for Account, Client, and Currency types.

  • Demonstrate  GraphQL queries to demonstrate requesting a list of Accounts along with Client details in a single query.

In this chapter, we'll cover:

  • Understand the foundation and structure of GraphQL schemas using schema definition language (SDL).

  • Overview of default scalar types and custom scalar types.

  • Query and mutation types in defining read and write operations.

  • The significance of non-nullable fields and how they ensure reliable data responses.

  • Installation of plugins for enhancing GraphQL development within IntelliJ IDE.

In this chapter, we'll cover:

  • Understanding the N+1 problem and its impact on performance in GraphQL implementations.

  • Introducing Batch Mapping as a solution to efficiently handle data fetching and mitigate the N+1 problem.

  • Learn to implement Batch Mapping in Spring Boot GraphQL applications.

  • Demonstrate how @BatchMapping reduces database hits and improves performance with a real-world example.

  • Understand the basics of implementing GraphQL mutations in a Spring Boot environment..

  • Walk through the steps to install and set up PostgreSQL for development.

In this chapter, we'll cover:

  • How to design GraphQL schema mutations for creating, updating, and deleting data.

  • Defining custom input types and passing arguments to mutations.

  • Use of scalar types like ID  to uniquely identify objects.

  • The significance of non-nullable assertions in GraphQL schema design to ensure data integrity.

In this chapter, we'll cover:

  • How to integrate Spring Boot with JPA and PostgreSQL to streamline database operations in a GraphQL API.

  • Develop an accountById method in the AccountsController, using @QueryMapping and @Argument annotations to handle GraphQL queries.

  • Learn to create and annotate methods with @MutationMapping to handle GraphQL mutations like addAccount, editAccount, and deleteAccount.

  • Map GraphQL arguments to method parameters - using the @Argument to method parameters in your Spring Boot application.

  • Implement - create, read, update, and delete  Database operations to integrate Spring Boot with JPA and PostgreSQL and  GraphQL API.

Execute and validate GraphQL mutations using Postman:

  • Test addAccount, editAccount, and deleteAccount, and verify their success through returned responses.

  • Understand mutation scripts and interpret the responses.

  • Verify database changes in PostgreSQL

In this chapter, we'll cover:

  • The need for extended scalar types in GraphQL.

  • Configure extended scalars in a Spring Boot application.

  • Define and use custom scalar types such as DateTime, CountryCode, and PositiveFloat in a GraphQL schema to enforce specific data formats and constraints.

In this chapter, we'll cover:

  • GraphQL Response Structure : Understanding the consistent format of GraphQL responses, including data, errors, and extensions.

  • Components of an Error Object: Detailing the fields within an error object, such as message, locations, path, and extensions.

  • Partial Response Handling: Implement and demonstrate GraphQL's "Partial Response" capability.

  • Compare GraphQL's error handling approach with REST.

In this chapter, we'll cover:

  1. GraphQL Exception Handling Basics: How GraphQL manages errors differently from REST APIs, including partial success scenarios.

  2. Implementing Exception Handlers: Utilizing the @GraphQlExceptionHandler annotation in Spring Boot for custom error responses.

  3. Practical Demonstration: Running example mutations to show partial responses and detailed error reporting.

In this chapter, we'll cover:

  1. Global exception handling in a GraphQL service using @ControllerAdvice and @GraphQLExceptionHandler.

  2. Learn to create custom exception classes and handle them in a centralized manner within GraphQL error specifications.

  3. Construct detailed GraphQLError objects, including using the extensions map for additional error context.

  4. Practical application of handling partial responses in GraphQL.

In this chapter, we'll cover:

  • Learn how WebGraphQlInterceptor allows interception of GraphQL requests and responses.

  • Explore how to inspect HTTP request headers in GraphQL operations.

  • Discover how to pass additional context from HTTP requests to GraphQL data fetchers.

  • Implement business logic validations using request interceptors.

  • Enhance error handling by modifying responses before they are sent back to clients.

In this chapter, we'll cover:

  • Introduction to Directives: Learn what GraphQL directives are and how they can be applied in schemas and queries.

  • Built-in Directives: Explore common built-in directives like @include, @skip, and @deprecated.

  • Discover how to control the inclusion or exclusion of fields in query responses using @include and @skip.

  • Demonstration of @deprecated directive.

In this chapter, we'll cover:

  • Understand the basics of Domain Graph Service (DGS) and its integration with Spring Boot for building GraphQL services in Java.

In this episode, we'll cover:

  • Setting up a Spring Boot project with the necessary Domain Graph Service (DGS) dependencies.

  • Defining a simple GraphQL schema with queries for accounts and related clients.

  • Implementing DGS components using @DgsComponent, @DgsQuery, and @DgsData annotations.

  • Creating a DataLoader for client using @DgsDataLoader.

  • Execute GraphQL queries using the GraphiQL interface.

In this chapter, we'll cover:

  • Understand the difference between monolithic and microservices architectural approaches.

  • Learn the concept and benefits of GraphQL Federation.

  • Learn how federated GraphQL gateway integrates multiple schemas.

In this episode, we'll cover:

  • The concept of subgraph and supergraph schema in GraphQL.

  • How the federated gateway composes subgraph schemas into a unified supergraph schema.

  • Rules of composition, ensuring coherent and functional federated schemas.

  • Overview of different gateway solutions - Apollo Server, WunderGraph Cosmo, GraphQL Mesh.

In this chapter, we'll cover:

  • Step-by-step guide to installing and setting up Apollo Server and Gateway services on a local machine.

  • Learn how to configure subgraphs and integrate their endpoints with Apollo Gateway.

  • Starting the Apollo Server and Gateway services, and verifying their functionality.

  • Introduction to Apollo Studio for querying, exploring APIs.

In this chapter, we'll cover:

  • Federated architecture using Apollo Gateway to compose multiple GraphQL services.

  • Learn to define GraphQL schemas for interconnected domains - Accounts and Clients.

  • API Implementation using DGS framework  for Account domain.

In this chapter, we'll cover:

  • Learn to define GraphQL schemas for interconnected domains - Accounts and Clients.

  • API Implementation using DGS framework  for Client domain.

In this episode, we'll cover:

  • How to run Accounts and Client applications locally for a federated environment.

  • Configuring the Apollo Federation Gateway to integrate multiple subgraphs.

  • Querying data from multiple domains through a unified GraphQL API.

In this episode, we'll cover:

  • How to combine DGS and Spring-GraphQL programming models to create modular and extensible GraphQL services.

  • Test integration with Apollo Federation Gateway to ensure services are correctly federated and working together.

In this chapter, we'll cover:

  • The fundamentals of HTTP Basic Authentication and its role in securing GraphQL applications.

  • Configuring HTTP Basic Authentication using Spring Boot, including security filters and user management.

  • Demonstrating HTTP Authentication in action with Postman.

In this chapter, we'll cover:

  • The basic concepts of OAuth 2.0 and its integration with OpenID Connect for both authorization and authentication.

  • Configuring OAuth 2.0 in a Spring Boot GraphQL application using Spring Security.

  • The roles involved in the OAuth flow, including User, Client, Resource Server, and Authorization Server, with a detailed explanation of their interactions.

In this chapter, we'll cover:

  • Installing and starting Keycloak as an Identity and Access Management (IAM) solution.

  • Creating and configuring a realm in Keycloak for managing users, roles, and permissions.

  • Setting up a client in Keycloak with OpenID Connect -  configuring redirect URIs, client credentials for OAuth 2.0 authentication.

In this chapter, we'll cover:

  • Initiating an OAuth 2.0 flow in Postman by configuring the authorization type and obtaining an access token from Keycloak.

  • Demonstrate the sequence of events in the OAuth 2.0 flow.

  • Sending a GraphQL query with an access token and validating the token in the GraphQL server for secure API access.

In this chapter, we'll cover:

  • Introduction to JSON Web Tokens (JWT) and its structure.

  • How JWT can be used for authentication and authorization in a Spring Boot - GraphQL application.

  • Implementation of a login query to generate JWTs.

  • Configuring JWT validation through a RequestHeaderInterceptor to ensure secure access to protected resources.

  • Testing JWT authentication and authorization in Postman with GraphQL queries.

GraphQL Security

In this chapter, we'll cover:

  • Utilize GraphQlTester for testing GraphQL queries and mutations within the Spring GraphQL framework.

  • Implement test cases for standalone GraphQL Services.

  • Implement test cases for federated services to ensure seamless integration.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Uses Spring Boot 3 and Java 21, which are modern technologies that are widely used in enterprise application development
Explores GraphQL Federation, which is a powerful approach to building scalable and maintainable microservice architectures
Covers GraphQL queries, mutations, schemas, and directives, which are fundamental concepts for building GraphQL APIs
Includes a Postman collection for each chapter, which allows students to easily test GraphQL queries and mutations
Requires setting up Apollo Server and Gateway, which may involve some initial configuration and learning of new tools
Teaches HTTP Basic Authentication, OAuth 2.0, and JWT, which are standard methods for securing web applications and APIs

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Build graphql federation with spring boot and dgs

According to students, this course offers a comprehensive deep dive into building GraphQL Federation architectures using Spring Boot 3 and the Netflix DGS framework. Learners appreciate the focus on practical implementation, covering essential topics like schemas, mutations, error handling, and testing with GraphQlTester. The hands-on approach, supported by quick start guides and Postman collections, helps solidify understanding. While the content is up-to-date with Java 21 and Spring Boot 3, some learners might find the material assumes a certain level of prior knowledge in Spring Boot, making it potentially challenging for those new to the ecosystem.
Important aspects like security and testing are covered.
"I appreciate that the course included sections on security (Basic Auth, OAuth 2.0, JWT)."
"The unit testing chapter using GraphQlTester was quite useful."
"Understanding how to secure GraphQL APIs is critical for professional applications, and this course addresses it."
Focuses on practical implementation with tools and examples.
"The hands-on exercises and coding demos were invaluable for putting theory into practice."
"Using the provided Postman collections made testing the queries and mutations straightforward."
"The quick start guides for each chapter were very helpful in getting the examples running smoothly."
Provides practical use of Spring Boot and Netflix DGS.
"Implementing GraphQL APIs specifically with Spring Boot 3 using the DGS framework was exactly what I needed."
"The sections on integrating Spring Boot with JPA and PostgreSQL were very practical."
"Learning how to test GraphQL APIs using Spring's GraphQlTester is a major plus."
Thoroughly explains core GraphQL and Federation topics.
"The course really helped me understand GraphQL Federation concepts and how they apply to microservices."
"I feel I now have a solid grasp on building GraphQL schemas and implementing queries and mutations."
"Learned how to effectively handle errors and use extended scalars in my Spring Boot applications."
May require prior Spring Boot/Java experience.
"While the course is good, I think a strong foundation in Spring Boot is necessary to keep up."
"Some parts move quickly, assuming familiarity with standard Spring development practices."
"This course seems best suited for developers already working with Spring Boot."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Build GraphQL Federation with Spring Boot 3 and NetFlix DGS with these activities:
Review Spring Boot Fundamentals
Solidify your understanding of Spring Boot basics to better grasp the course's advanced concepts.
Browse courses on Spring Boot
Show steps
  • Review Spring Boot annotations and configurations.
  • Practice building simple REST APIs with Spring Boot.
  • Familiarize yourself with dependency injection and auto-configuration.
Read 'GraphQL in Action'
Gain a deeper understanding of GraphQL principles and best practices.
View GraphQL in Action on Amazon
Show steps
  • Read the chapters on schema design and query optimization.
  • Experiment with the code examples provided in the book.
  • Relate the concepts to the course's GraphQL Federation topics.
Implement GraphQL Queries and Mutations
Reinforce your understanding of GraphQL queries and mutations through hands-on practice.
Show steps
  • Create a simple GraphQL API with basic queries and mutations.
  • Practice nesting queries and using aliases.
  • Implement CRUD operations using GraphQL mutations.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Blog Post: GraphQL Federation Benefits
Solidify your knowledge by explaining the benefits of GraphQL Federation in a blog post.
Show steps
  • Research the advantages of GraphQL Federation over traditional approaches.
  • Outline the key benefits, such as scalability and modularity.
  • Write a blog post explaining these benefits with examples.
  • Publish the blog post on a platform like Medium or Dev.to.
Build a Federated E-commerce API
Apply your knowledge by building a federated e-commerce API with multiple subgraphs.
Show steps
  • Design the schema for different subgraphs (e.g., products, users, orders).
  • Implement each subgraph using Spring Boot and Netflix DGS.
  • Set up Apollo Federation Gateway to connect the subgraphs.
  • Test the federated API with complex queries.
Read 'Production Ready GraphQL'
Learn best practices for deploying and maintaining GraphQL APIs in production.
Show steps
  • Read the chapters on security and performance optimization.
  • Implement the recommended practices in your federated API project.
  • Set up monitoring and logging for your GraphQL services.
Contribute to a GraphQL Library
Deepen your understanding by contributing to an open-source GraphQL library or tool.
Show steps
  • Identify a GraphQL library or tool that interests you.
  • Explore the codebase and identify potential areas for contribution.
  • Contribute code, documentation, or bug fixes to the project.
  • Participate in code reviews and discussions with other contributors.

Career center

Learners who complete Build GraphQL Federation with Spring Boot 3 and NetFlix DGS will develop knowledge and skills that may be useful to these careers:
Microservices Developer
A Microservices Developer builds and maintains individual services within a microservices architecture. This course may be useful to Microservices Developers with its focus on GraphQL Federation, Domain Graph Service, and Apollo Federation Gateway. These technologies are important tools for building scalable and maintainable microservices. The course provides hands on experience with federated schemas, error handling, and request interceptors, all of which are essential for developing robust microservices. In particular, learning to implement GraphQL APIs using Spring Boot 3 and Java helps the microservice developer.
API Developer
An API Developer specializes in creating and maintaining Application Programming Interfaces that allow different software systems to communicate. This course may be useful to API Developers by providing the specific skills and knowledge to build robust, scalable GraphQL APIs. The course, with its focus on GraphQL Federation, Domain Graph Service, and Apollo Federation Gateway, directly addresses the challenges of designing and implementing modern APIs. The course's comprehensive approach, from schema design to testing, enables API developers to create high quality APIs.
Backend Engineer
A Backend Engineer designs, develops, and maintains the server side logic and databases that power applications. This course may be useful to the Backend Engineer, providing them with expertise in building scalable and efficient GraphQL APIs using Spring Boot 3 and Java 21. The course's focus on GraphQL Federation, Domain Graph Service (DGS), and Apollo Federation Gateway equips the engineer with the skills to architect distributed systems, handle data efficiently, and manage API integrations, all of which are vital for modern backend development. Learning to test queries and mutations helps the backend engineer deliver robust and reliable systems.
Software Architect
A Software Architect is responsible for high level design choices and technical standards, including software coding standards, tools, and platforms. This course may be useful to Software Architects by helping them understand how to architect scalable, distributed systems for modern applications using GraphQL Federation with Spring Boot 3 and Java 21. Understanding the nuances of GraphQL schemas equips the architect with options when making design choices across an organization. This course gives the architect a solid grounding in these new technologies.
Technical Lead
A Technical Lead manages a team of developers and guides technical decisions. This course may be useful to Technical Leads by providing them with in depth knowledge of GraphQL Federation, Domain Graph Service, and Apollo Federation Gateway. Understanding these technologies enables the lead to guide their team in building scalable and robust APIs using Spring Boot 3 and Java 21. Knowing how to write effective GraphQL queries and mutations helps the lead guide junior developers appropriately.
Solutions Architect
Solutions Architects design and guide the implementation of end to end solutions and consider cloud deployment, scalability, maintainability, and security. This course may be useful to Solutions Architects, providing expertise in GraphQL Federation, DGS, and Apollo Federation Gateway, critical components for modern cloud native architectures. The course focuses on the practical aspects of building and testing GraphQL APIs, ensuring that the architect can design solutions that are not only scalable but also robust. Learning the testing frameworks described in the course ensures the solutions architect can validate assumptions.
Full-Stack Developer
A Full Stack Developer is comfortable working with both front end and back end technologies. This course may be useful to Full Stack Developers by providing them with comprehensive knowledge of building GraphQL APIs using Spring Boot 3, Java 21, and related technologies. The focus on GraphQL Federation, Domain Graph Service (DGS), and Apollo Federation Gateway enables full stack developers to create scalable and efficient APIs that support modern web applications. Understanding the details behind GraphQL queries helps the full stack developer build a better end to end product.
Data Engineer
A Data Engineer designs, builds, and manages the infrastructure for data storage and processing. This course may be useful to Data Engineers by helping them understand how to implement GraphQL Federation, Domain Graph Service, and Apollo Federation Gateway, which are essential tools for building scalable and efficient data APIs. The course's focus on federated schemas and data integration techniques enables data engineers to create unified data access layers across distributed systems. Learning the testing frameworks provided in the course helps data engineers validate their assumptions.
Cloud Architect
Cloud Architects design and oversee the implementation of cloud computing strategies. This course may be useful to Cloud Architects by equipping them with the knowledge to build scalable, distributed systems using GraphQL Federation with Spring Boot 3 and Java 21. Expertise in Domain Graph Service (DGS) and Apollo Federation Gateway enables architects to design robust cloud native applications. Understanding GraphQL patterns and practices ensures consistent and efficient data access across cloud environments.
DevOps Engineer
A DevOps Engineer automates and streamlines software development and deployment processes. This course may be useful to DevOps Engineers by helping them understand how to implement GraphQL Federation, Domain Graph Service, and Apollo Federation Gateway in their CI/CD pipelines. The course provides insights into building scalable and efficient GraphQL APIs, which are crucial for modern cloud native applications. Being able to test queries can help automate parts of the deployment pipeline. Learning how to implement GraphQL APIs using Spring Boot 3 and Java helps with these processes.
Systems Integrator
Systems Integrators connect different computing systems and software applications to work together. This course may be useful to Systems Integrators by providing them with knowledge of GraphQL Federation, Domain Graph Service, and Apollo Federation Gateway. The course focuses on building scalable and distributed systems, which are essential for integrating disparate systems. The course's comprehensive approach to federated schemas, error handling, and request interception equips integrators with the tools to ensure seamless and efficient data exchange. Learning how to implement GraphQL APIs using Spring Boot 3 and Java is extremely helpful to systems integrators.
Enterprise Architect
Enterprise Architects develop a holistic view of an organization's strategy, processes, information, and technology assets. This course may be useful to Enterprise Architects by providing them with the insight to guide the organization to adopt GraphQL Federation, Domain Graph Service, and Apollo Federation Gateway to modernize their APIs and data access layers. The course's comprehensive approach to building scalable and distributed systems helps ensure that the enterprise architecture is robust and efficient. Understanding the nuances of GraphQL schemas equips the enterprise architect with options when making design choices across an organization.
Principal Engineer
Principal Engineers usually work in medium to large enterprises and are individual contributors who influence technical direction and mentor other engineers. The course may be useful to Principal Engineers, helping them understand how to implement GraphQL Federation, Domain Graph Service (DGS), and Apollo Federation Gateway. These are essential tools for modernizing API infrastructure using Java and Spring Boot 3. Learning about the best practices in the course can enable more robust applications inside the enterprise.
Data Architect
Data Architects design and manage data storage and processing systems. This course may be useful to Data Architects by providing them with the know how to implement GraphQL Federation, Domain Graph Service, and Apollo Federation Gateway to manage data access across distributed systems using Java and Spring Boot 3. These skills are increasingly relevant as enterprises look to modernize the ways that data is accessed. Learning how to implement GraphQL APIs may be useful.
IT Consultant
IT Consultants advise organizations on how to best use information technology to meet their business objectives. This course may be useful to IT Consultants by helping them understand how to leverage GraphQL Federation, Domain Graph Service, and Apollo Federation Gateway to modernize their clients' API strategies. The course's focus on building scalable and efficient GraphQL APIs using Spring Boot 3 and Java 21 provides consultants with practical knowledge they can apply in engagements. The course may equip consultants to suggest particular strategies and tactics to clients.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Build GraphQL Federation with Spring Boot 3 and NetFlix DGS.
Provides a comprehensive introduction to GraphQL, covering its core concepts, schema design, and query optimization. It's particularly useful for understanding the fundamentals before diving into GraphQL Federation. The book offers practical examples and real-world scenarios, making it an excellent resource for both beginners and experienced developers. It valuable reference for understanding the underlying principles of GraphQL.
Focuses on the practical aspects of deploying and maintaining GraphQL APIs in production environments. It covers topics such as security, performance optimization, and monitoring. It is particularly helpful for understanding how to secure and scale GraphQL Federation implementations. This book is more valuable as additional reading than it is as a current reference.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser