
GraphQL is a query language that empowers clients to request exactly the fields they need, as shown by filtering citizenship and credit score while omitting unnecessary data, with REST comparisons.
Enable hot reloading by installing nodemon globally and adding a dev script to npm run dev, so changes auto restart the server without manual restarts.
Define a product object type with name, description, quantity, price, and on sale fields, and implement a products query returning an array of these objects via a resolver.
Define a many-to-one relation where every product has one category and each category can include multiple products, then fetch related category data via GraphQL resolvers.
Explore adding a filter object to GraphQL queries to retrieve only on-sale products, via a products filter input with an on sale status, applied to products and categories.
Define and test new GraphQL mutations to add products and reviews, with add product input, linking products to categories, and returning created items.
Learn to implement delete product with cascade to associated reviews in a GraphQL mutation, updating the schema to return a boolean and cascade deletions.
Apply schema design rules to build a production-ready GraphQL API for grouping cars into manual and automatic groups, with join tables and publish controls.
Start with a high level view of object types and their relationships to simplify the GraphQL schema, focusing on manual and automatic group, image, group membership, cars, and features.
Explain why the group membership object type is an implementation detail and why a GraphQL API should return cars within a specific group instead of the membership data.
Apply rule four by adding only necessary fields to your GraphQL API, such as id, features, apply features, car, name, image id, and body HTML, to avoid breaking changes.
Always use object references instead of id fields in GraphQL, replacing image id with an image object that includes id and url for more useful client queries.
Use enums to constrain feature fields to a set of values, replacing dynamic strings with options such as inline engine, four cylinder engine, twin engine, and red or black paint.
Learn how to structure mutation inputs in GraphQL with Node to reduce duplication by introducing a reusable group input, using nullable fields, and requiring a group id for updates.
Set up an Apollo server with TypeScript to build your GraphQL API, learn that TypeScript is a superset of JavaScript, and use its type system to catch errors early.
Explore building a Postgres schema with posts, users, and profile tables, and connect it to a GraphQL API using prisma as an object-relational mapper, simplifying data queries.
Establish one-to-many and one-to-one relationships by linking posts to users with foreign keys and a unique constraint for profiles, using Prisma relations and primary key references.
Create data with prisma by implementing a post creation resolver that returns a post or user errors via a post payload, using async/await and TypeScript types.
Learn to retrieve posts with Prisma by defining a posts query, using findMany with no conditions, and ordering by createdat descending to fetch the most recent posts.
Implement a profile query to fetch a specific user's profile and related user information and posts, using a unique user ID and a profile resolver with Prisma to return data.
Explore relational post queries in GraphQL by linking posts to users using author id, building post and user resolvers, and handling published versus own profile post visibility.
Tackle the N+1 problem by batching and caching queries, reducing database transactions from many to just a few, using an in-memory store and data loaders.
Add a data loader to batch and cache resolver requests, using Prisma to fetch multiple users efficiently.
Connect a GraphQL API to a client by performing queries and mutations from a React app, using Apollo playground to test, and wire up posts, profiles, and auth routes.
Learn to fetch a profile and its posts by passing a dynamic user ID as a GraphQL variable, retrieving name, bio, and post details.
Implement sign in and sign up flows with GraphQL mutations, pass credentials to obtain a token, store it in local storage, and handle errors.
Create a post by implementing a postCreate mutation with title and content, wiring Apollo useMutation, validating inputs, handling errors, and updating UI with the new post.
Complete the course by implementing the post delete and post update mutations in your React app, practice these mutations, and optionally enhance the user interface for a better user experience.
This course will teach you how to build a GraphQL API from absolute scratch. It is taught by a developer that has over 3 years of experience with GraphQL and has worked with it in multiple enterprise companies. By the end of this crash course, you will become an expert and know more than 99% of GraphQL hobbyists. This course isn't just aimed to teach you GraphQL, but how to properly utilize it in a real application. I hope you enjoy it!
We will be learning everything from scratch and thus you can be a GraphQL beginner to take this course. However, we will be using JavaScript as our primary language and thus some JS knowledge is ideal. We will also connect our server to the frontend and we will be using React as our client. Thus any frontend knowledge would be good but not unnecessary.
This course will teach you:
- What is GraphQL
- What are the benefits of GraphQL
- Learn GraphQL terminology
- How to build a GraphQL server
- Modern design principles
- Adding Authentication
- Working with Prisma v3 to interact with a Postgres DB
- Connecting GraphQL to the client
- Improve performance by learning about the n + 1 problem and solving it will data loaders