
Explore how GraphQL overcomes REST API drawbacks by providing a declarative, strongly typed schema that lets clients request only the needed data, eliminating overfetching and versioning.
Set up a spring boot GraphQL project using start.spring.io with Gradle Kotlin, Java 17, and dependencies for GraphQL, H2, and Spring Data JPA; generate, unzip, and open in IntelliJ.
Define a GraphQL schema with queries, mutations, and subscriptions; implement a hello world query and resolver; and route all requests to a single post /graphql endpoint with a GraphiQL playground.
Create a parameterized GraphQL query by defining a required name argument, mark fields with non-nullable exclamation marks, register the query with a resolver, and test it in the playground.
Learn how to define and return an array in GraphQL using Spring Boot Kotlin and React Apollo, including nullable vs non-null arrays, and named versus anonymous queries.
Define a custom GraphQL event type with an id (UUID) and event type, and implement a query resolver in Kotlin. See how GraphQL returns only requested fields, unlike REST.
Learn how to implement a field resolver in GraphQL to fetch a post's author via schema mapping and parent data, enabling nested author queries.
Create user and post entities in a spring application, integrating users and posts with a many-to-one and one-to-many relationship, and prepare the model package for repositories and services.
Define user and post repositories and services using JPA, map post authors, expose GraphQL get post, and seed an in‑memory H2 database with a sample user and post.
Define a GraphQL recent posts query with non-null page and size, map to a resolver, fetch paged posts via a page request, and return the post list.
Learn to define and resolve GraphQL mutations, including add user that returns a UUID, with input types and resolvers, in a Spring Boot Kotlin and React Apollo setup.
Create a get users query with pagination, implement page and size parameters, and refactor into a dedicated user resolver and service to fetch and map users.
Refactor the data flow to fetch users via a service using post id, replacing post repository usage, adding a find by post id function, and cleaning up underscores in naming.
Create a post mutation in a GraphQL stack using Spring Boot, Kotlin, and React Apollo by defining add post input, author id, and returning the post id and title.
Implement a total post field resolver on the user type to count a user's posts by invoking the post service's get post by author function, returning the size.
Practice exercise adds a new entity comment with one-to-many relationships to users and posts; implement the entities and mappings, then verify with the H2 console and post/user ID queries.
Define a GraphQL schema with a comment type linked to author and post, implement a getComments query with page and size, and resolve fields using resolvers.
Implement field resolvers for author and post within the comment type in a GraphQL schema. Emphasize single-responsibility and minimal dependencies while using dummy data before DB integration.
Implement a comment entity with id, text, and author and post relationships, using many-to-one mappings with author_id and post_id join columns, and update user and post entities to map comments.
Create a comment repository and service, fetch comments from the database via the resolver, and map entities to comments, including author and post data.
Link posts to their comments and users to their comments through resolvers, fetching all comments by post id or user id and returning comment lists.
Implement add comment mutation with input type, validate author and post exist, persist the new comment in the database, and return the created comment's id and text.
explore the n+1 problem in GraphQL, showing how resolving posts, comments, and authors via field resolvers causes multiple database calls, and outline upcoming validation with loggers.
Wire a forge logger into post, comment, and author resolvers to trace posts, comments, and authors queries, revealing an n+1 problem from asynchronous field resolution and a forthcoming fix.
Learn to resolve the n plus one problem by using GraphQL batching with batch mapping, replacing field resolvers, and mapping post ids to their comments for efficient data access.
Learn how GraphQL scalar types work, define custom scalars like date, map to local date with a library, and configure runtime wiring to enable test queries.
Define and map a date time scalar in graphql to offset date time, following RFC 339 compliance, and configure extended scalar types for spring boot, kotlin, and react apollo.
Define a regex-based phone number scalar in GraphQL using extended scalar types. Implement a compiled pattern for validation and map phone numbers in queries and resolvers.
Learn to implement a custom email scalar from scratch in GraphQL, including defining, serializing, deserializing, validating with regex, and wiring it into a resolver.
Explore GraphQL directive validations with @Size, applying length constraints on arguments and input fields, using extended scalars, and configuring schema-level validation to enforce data contracts.
Explore implementing @NotEmpty and @ContainerNotEmpty directives in a GraphQL Spring Boot Kotlin and React Apollo setup. Apply validations to arguments and inputs and use size constraints for lists.
Explore a regex-based validation using a pattern directive in GraphQL, defining a regex expression, label, and message, and applying it to an email field for input validation.
Create a custom GraphQL directive @uppercase and wire it into the schema, so field responses transform to uppercase via a runtime binding and data fetcher wrapper.
Explore the spring security architecture, including the filter chain and chain proxy, authentication managers, and multiple authentication providers. See how the security context stores authentication data and enables per-request authorization.
Develop a Kotlin singleton JWT util to generate a token with username as subject, roles in claims, and one-day expiry, then validate it with the same signed secret key.
Explore writing unit test cases for JWTs, generating tokens with a long secret, and validating signatures to ensure subject and roles like admin are securely verified.
Configures spring security for a GraphQL app by building a security filter chain, replacing the authentication filter, enabling basic authentication, and allowing requests for now while planning JWT-based protection.
Create a login mutation that accepts username and password, generates a JWT token with a secret key from the environment, and demonstrates issuing tokens and validating future requests.
Enable method security and use pre authorize with has role to restrict the add post mutation to users with admin role, implementing JWT token authentication for GraphQL endpoints.
Implement a custom Spring security flow with a JWT filter, authentication manager and provider to validate tokens from the authorization header and set the security context for protected endpoints.
Learn how to secure GraphQL queries and mutations using @PreAuthorize, distinguishing authorities from roles, and applying has role and has authorities guards for admin and viewer permissions.
Add register mutation with password encoding using bcrypt, update the user entity with password and roles, and ensure passwords and roles are not exposed in responses.
Enhance login by validating credentials, checking user existence, encoding passwords, and issuing a JWT token with user roles (admin or viewer) for secure authentication and authorization.
Set up Kotest and integration test cases for simple and secure GraphQL queries in a Spring Boot Kotlin project, including hello world and get events.
Write integration tests for GraphQL queries with variables, validating a named greet query, passing dynamic variables, and asserting both success and validation errors.
Write integration tests for the add user mutation and user resolver in a Spring Boot Kotlin React Apollo stack, using GraphQL tester and JWT-based authorization.
Learn to write and run login mutation tests in a GraphQL flow, including creating a user, executing login with username and password, and validating the returned JWT token.
Conduct integration tests for secure operations by validating a token-protected GraphQL fetch of users, using @PreAuthorize to enforce access and verify authorized versus unauthorized outcomes.
Develop and run a secured GraphQL get post query test, seed a user and a post, and verify the response includes post title, description, and author name.
Are you someone who want to learn GraphQL with spring boot Kotlin & React and how to test GraphQl application then you are in right place :).
In Easy way you will learn How to create full stack project with Spring boot GraphQl and React With JWT based Authentication and Authorization.
This course enables you as a GraphQL engineer who can explain graphQL in simple words to anyone.
Throughout the course, we will practice a lot writing graphql schema and we will understand how the graphQL ecosystem works with spring boot.
You will learn what is GraphQl and how to set up the graphQL project with spring boot & React With Security Using JWT.
What is GraphQL?
A query language for your API
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
Ask for what you need,
get exactly that
Send a GraphQL query to your API and get exactly what you need, nothing more and nothing less. GraphQL queries always return predictable results. Apps using GraphQL are fast and stable because they control the data they get, not the server.
In this course, you will learn:-
What is GraphQL?
Difference between GraphQL and REST API
How to Setup Spring Security In GraphQL
How to use JWT token
How to Setup Role based Authorization In GraphQL
How to Setup React Application With Apollo Client
How to Setup Codegen based Development Workflow
Authentication and Authorization At React Level
What is Query in GraphQL?
What is Mutation in GraphQL?
What is Schema in GraphQL?
What is QueryResolver in GraphQL?
What is MutationResolver in GraphQL?
What is FieldResolver in GraphQL?
How to Integrate GraphQL application with database using Spring Data JPA.
How to write an integration test for graphQL.
How to maintain graphQL schema.
How to create custom scalar type in graphQL
How to perform input validation in graphQl
How to transform field value with @Directive
How to solve N+1 query problem in graphql
Formik With Yup Validation
React Router Dom V6 Integration
MUI - Material UI with React