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:
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.
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.
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:
GraphQL Exception Handling Basics: How GraphQL manages errors differently from REST APIs, including partial success scenarios.
Implementing Exception Handlers: Utilizing the @GraphQlExceptionHandler annotation in Spring Boot for custom error responses.
Practical Demonstration: Running example mutations to show partial responses and detailed error reporting.
In this chapter, we'll cover:
Global exception handling in a GraphQL service using @ControllerAdvice and @GraphQLExceptionHandler.
Learn to create custom exception classes and handle them in a centralized manner within GraphQL error specifications.
Construct detailed GraphQLError objects, including using the extensions map for additional error context.
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.
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.
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.