
Discover GraphQL, a query language for APIs that lets front-end apps like Angular request exactly the data they need, backed by a strongly typed schema and interactive tooling.
GraphQL unifies data requests into a single endpoint, avoiding overfetching and underfetching. It replaces multiple REST calls with queries and mutations, enabling precise, efficient data shaping and built-in introspection.
Install the node.js runtime to work with the angular framework, using either the official installer from node.js.org or the node version manager, while checking compatibility with angular 19.2.
Install and verify Angular CLI locally, learn to create projects and generate components, services, and modules. Run a live reloading dev server and note version 19.2.7 with PowerShell script fixes.
Create a new Angular project with ng new, selecting scss, and decide between standalone or module-based architecture. Initialize dependencies and a git repository for a GraphQL with Angular beginners course.
Launch your Angular project from the root folder, explore the src/app components and modules, and run the app with ng serve or npm run start to view it at localhost:4200.
Set up a fake GraphQL server with json-graphql-server to quickly prototype Angular apps using a simple .js file as a mock database. Recognize its limitations: no subscriptions, not for production.
Explore how json-graphql-server offers a built-in GraphiQL IDE to write, test, and run GraphQL queries and mutations directly in your browser, plus an explorer for visual query building.
install the PrimeNG library to access ready-to-use UI components, including a fully styled data table, and follow the installation guide to configure providers and verify with a p-button.
Create environment files to store the API URL for the GraphQL server. Configure environment.development.ts and environment.ts by adding apiUrl with the server address, noting the possible /graphql suffix.
Understand the GraphQL schema as a contract between front end and back end that defines data types like post, user, and comment, and enables queries, mutations, and documentation with GraphiQL.
Define data shapes with types, scalars, and custom types in GraphQL. Fetch exact fields with queries and mutate to create, update, or delete data, returning only requested results.
Create an Angular component and send your first GraphQL query with HttpClient. Bind the query in a getPosts method, fetch data on ngOnInit, and subscribe to the observable.
Learn how to install and configure Apollo Angular as a full-featured GraphQL client with built-in caching for Angular, including setup with ng add apollo-angular, environment-driven API URLs, and tsconfig tweaks.
Learn how graphql.module.ts initializes Apollo in an angular app with createApollo and httpLink, using an in-memory cache for performance. Wire the module into app.module.ts via dependency injection.
Inject the Apollo service in Angular and use watchQuery with a gql-wrapped query to fetch and subscribe to data via valueChanges. Monitor loading, data, and error to drive the UI.
Learn to integrate PrimeNG p-table in Angular app, import TableModule, bind posts from a GraphQL query, and configure columns for id, title, and views with optional chaining for undefined data.
Handle the query loading state in a GraphQL with Angular app by using the PrimeNG progress spinner, importing ProgressSpinnerModule, and toggling the posts table with ngIf until data loads.
Learn how to enable initial loading in GraphQL with Angular by using useInitialLoading globally in the Apollo config, so the loading state and spinner appear immediately while data loads.
Compare watchQuery and query to fetch data from the server in Apollo Angular. Identify that watchQuery updates the UI via in-memory cache, while query fetches data once with no updates.
Switch to the Apollo query method in the posts component and subscribe with a query configuration. The caption notes that query lacks value changes observable and useInitialLoading, altering loading behavior.
Learn to manage watchQuery by recognizing it returns a QueryRef and does not unsubscribe, leading to memory leaks; store the result in postsQuery, track the sub, and unsubscribe in ngOnDestroy.
Explore polling in GraphQL with Angular to achieve near-real-time updates by requerying at intervals with a pollInterval setting, ideal for admin dashboards, chat refresh, and notifications lists.
Learn to programmatically control GraphQL polling in Angular using watchQuery's QueryRef with startPolling(interval) and stopPolling to refetch data based on user interactions or app state.
Refetch data on user action in Angular by calling refetch from QueryRef, avoiding constant polling. Wire a refresh button with onClick to trigger the refetch and update the post list.
Update the mock db to include a comment field, then fetch a single post (id 1) with a GET_POST GraphQL query via Apollo in Angular, log the response.
Define a required GraphQL $id variable of type ID, pass it via a variables object to getPost or watchQuery, and fetch the post details by id.
Learn how to type GraphQL data with TypeScript in an Apollo Angular app by defining Post and GetPost types, and using GetPostVariables, GetPosts, and Omit for strong type safety.
Improve type safety in Angular GraphQL queries by typing QueryRef with a GetPosts type, enabling precise intellisense, and ensuring correct data structure for all posts.
Refactor your Angular app by moving post queries and types into dedicated GraphQL files (posts.queries.ts and posts.types.ts), export them, and update imports to keep the posts-table component focused.
Discover how GraphQL fragments create reusable field sets to reduce duplication, simplify queries, and maintain consistency across posts with ID, title, and comment.
Create a fragment named PostTableFields on Post to fetch id, title, and views, and reuse it in two queries using gql and the PostTableFields spread.
Learn to attach authorization headers (including JWT tokens) to every GraphQL request by using setContext and ApolloLink in Angular, demonstrating a global header strategy that replaces per-call headers.
Enable withCredentials in Apollo Client to include cookies with GraphQL requests for cookie-based authentication; otherwise sessions may be lost. The server must set a specific Access-Control-Allow-Origin rather than *.
Fetch the total number of posts stored in the mock database using GraphQL’s _allPostsMeta.count in a GraphiQL session, and update types to expose postsTotalCount while guarding against loading data.
Learn how to implement server-side pagination in Angular with GraphQL, using perPage and page variables, lazy loading, and Apollo caching to efficiently fetch posts.
Learn how to implement efficient pagination in GraphQL with Angular by initializing a single QueryRef in ngOnInit, using fetchMore for updated pages, and configuring type policies for correct cache merging.
Configure the PrimeNG toast component to display error messages by importing ToastModule and MessageService, adding to providers, and placing the p-toast tag; create a ToastService with showError(message) that uses MessageService.add.
Configure errorPolicy in Apollo Angular to manage GraphQL and network errors, using none, ignore, and all, and reveal proper messages via toast notifications.
Implement a global error handler in Angular using Apollo Link and onError, logging GraphQL and network errors and displaying toast notifications via a dependency-injected toastService.
Discover how Apollo Angular's in-memory cache uses normalization and unique identifiers to serve GraphQL data and avoid duplication. Configure caching in app.config.ts or graphql.module.ts with addTypeName, resultCaching, possibleTypes, and typePolicies.
Explore how Apollo fetchPolicy manages cache and network interactions for queries, balancing performance and accuracy with options like cache-first, cache-only, network-only, standby, and no-cache.
Explore mutations in GraphQL with Apollo Angular and use mutate, variables, and the cache to automatically update the UI.
Implement a delete post mutation with an id variable in Angular GraphQL, reuse the PostTableFieldsFragment and types, and refresh the UI to reflect deletion on a mock server.
Learn to manually update the Apollo cache when deleting a post after a mutation, using update with readQuery and writeQuery for paginated lists, and refetch to keep the interface accurate.
Define updatePost and createPost mutations in GraphiQL, specify required versus optional fields, and prepare mutation types and variables for Apollo cache.
Build a dynamic Angular post form using reactive forms, PrimeNG components like p-inputnumber and pInputText, and a BehaviorSubject driven service to create or edit posts.
Learn how to implement a createPost mutation by adapting the updatePost method, wiring the post form to submit new posts, and refresh the list with refetchQueries after creation, accommodating pagination.
Enable the useMutationLoading flag to emit an initial loading state during GraphQL mutations with apollo.mutate, then emit the final result with loading false.
Explore GraphQL subscriptions for real-time updates, when to use them for events like new comments or status changes, and how to enable WebSocket transport with graphql-ws in Apollo Angular.
Build a mock GraphQL backend with express to support subscriptions, defining a schema with Post, allPosts, createPost, and postAdded, using in-memory data and WebSocket updates.
Install graphql-ws to enable websocket-based GraphQL subscriptions, then configure a ws link and a shared http link, using split to route subscriptions via wsUrl and queries via httpLink.
subscribe to the postAdded subscription in Angular with Apollo using gql, initialize in ngOnInit via dependency injection, log new posts, and observe a live websocket data stream.
If your goal is to build Angular applications that communicate with a GraphQL-based server, you're in the right place.
This course does not require prior knowledge of Angular to get started, although some familiarity will certainly make the learning process smoother.
Throughout the course, you'll learn everything you need to effectively use GraphQL in your frontend projects - from understanding the basics of GraphQL queries, mutations, and schemas, to integrating with APIs using both HttpClient and Apollo Client.
We'll also cover how to manage application state with Apollo's cache system, handle errors, and implement real-time updates using subscriptions!
In that course, you'll create a complete CRUD application in Angular that communicates with a GraphQL backend — step by step, from scratch. Course focuses on practical, real-world examples.
All lessons were designed with a beginner-friendly approach in mind, but it’s completely natural to have questions if you haven’t worked with the Angular framework before.
We will be working with Angular version 19, but the examples used in the course have been written in a way that ensures compatibility with older versions of Angular as well.
Don’t worry about that, if you have any questions during the course, don't hesitate to ask in the Q&A section or send me a direct message.
I'm here to help and will gladly assist you with any problems you encounter ; )