
Build efficient GraphQL APIs with Django and Strawberry by defining models, querying data, creating and updating records, handling relationships, applying advanced filters, and structuring scalable GraphQL schemas using Django's ORM.
Prepare your development environment for a Django application with PostgreSQL by configuring the code editor, Python tools, Docker, and the initial project structure.
Install Visual Studio Code on Windows or Mac OS, customize the interface, explore core features, install extensions, and use the integrated terminal to manage your files and folders.
Learn to set up Python formatting and linting in Visual Studio Code using rough, configure a project-level settings.json, and automatically organize imports and format on save with line length 88.
Install and set up docker desktop, then explore images, containers, and volumes for running apps in isolated environments; pull docker hub images and persist data with volumes.
Learn to set up a PostgreSQL and Django development environment in docker using docker-compose and a custom dockerfile, define services, ports, and environment variables, and test container readiness.
Automate the full Django project bootstrap inside a container using Docker Compose, including PostgreSQL, admin user creation, migrations, and app setup, with volume binds for live development.
Master the fundamentals of Django models within a Django project and connect Python code to your database, using Strawberry to build a clear GraphQL schema.
Explore the Django project's database schema using an ERD to visualize table relationships. Understand primary, foreign, and alternative keys, data types, and one-to-many links that guide Django model definitions.
Define Django models in Python, mapping them to database tables, using the inventory app's models to generate tables like inventory_category, and customize table names with db_table if needed.
Define Django model fields and choose the right data types—from text and character fields to boolean, date/time, and decimal—mapping an ERD to models and migrating to Postgres.
Learn to implement one-to-many relationships in Django with foreign keys, configure on delete actions, use related names for reverse queries, and build hierarchical categories via self-referential keys.
Explore how to model many-to-many relationships in Django using automatic and manual through tables, linking products, promotion events, and orders with foreign keys and extra fields.
Explore how Django models control field behavior with default, blank, null, and unique options, including setting defaults, allowing blanks, handling nulls, and enforcing uniqueness.
Create a one-to-one relationship between product and stock management in Django using a 1 to 1 field, placing the foreign key on stock management and enforcing uniqueness.
Register your Django models in the admin site to view, add, and manage data, then log in to localhost:8000/admin to interact with models and customize their string display.
Explore how GraphQL with strawberry connects to Django models, enabling a flexible, structured API. Learn installation, setup, writing queries and resolvers, and using the built-in interface to explore the schema.
Learn how GraphQL provides a single endpoint to fetch exactly the needed data, and how Strawberry enables Django integrations with type hints, decorators, schemas, and queries.
Install strawberry GraphQL and integrate with Django using strawberry Django, create a new app and a GraphQL folder structure (types, queries, schema), and expose a GraphQL endpoint.
Define GraphQL types with strawberry by building a category type as a blueprint of data, including id, parent_id, name, slug, active, and level, and marking optional fields.
Learn to write a strawberry resolver for GraphQL by defining a categories field, returning a hard coded list of category types, and wiring it to the query entry point.
Import strawberry and the query class, register the query as the API entry point with schema = strawberry.schema(query=query) to build the GraphQL schema and expose the categories field.
Connect Django routes to a GraphQL schema with the Strawberry view, enable browser queries via GraphiQL, and configure URLs while renaming modules to avoid conflicts.
Learn to replace manual GraphQL types with Django models using strawberry Django for dynamic model-based type generation from models.
Learn to add simple descriptions to GraphQL schema with strawberry, documenting queries, types, fields, and arguments to improve clarity, discoverability, and editor tool support like Graphiql.
Define and manage strawberry types and inputs for GraphQL, using decorators and field level resolvers to control optional fields, with inputs created manually or from Django models.
Learn how GraphQL types define the shape of data returned by the api and how input types validate data sent to it, shaping the schema as a contract for clients.
Learn to define GraphQL object types manually with strawberry, mapping data fields like id and optional fields, then create a strawberry type and resolver to query products.
Define optional and nullable fields in GraphQL with strawberry, using Python typing to express None and Optional, and distinguish null from empty strings in the generated schema.
Intercept and clean empty string values with a field level resolver in strawberry. Replace empty strings with none, map to a custom field, and raise errors when required.
Connect Django models to a GraphQL API by auto-mapping fields with strawberry Django and strawberry auto, creating a clean GraphQL schema from existing models.
Apply field-level resolvers with Django model auto types in strawberry to validate the description field, prevent empty strings, and return clean data while handling null values.
Define input types in Strawberry with the input decorator to validate structured data for mutations and queries. Create a product input with optional fields and explain type validation.
Define default values for strawberry input types to make fields optional and provide fallbacks when clients omit data. Use none, false, or defaults to control optionality and keep mutations clean.
Define input types in Strawberry from Django models to reuse your model structure while choosing which fields to accept, with options to define fields or use auto.
Create, update, and delete records using structured inputs to manage one-to-many, one-to-one, and many-to-many relationships, with nested structures, constraints, and safe deletions.
Organize a Django GraphQL project by building separate folders for types, inputs, mutations, and queries, and use a single schema file to combine them, separating inputs from outputs.
Define input types that include a foreign key, implement a mutation to create records, and return related category data when querying products in a Django GraphQL Strawberry project.
Learn to create a product with a one-to-one stock management record using a strawberry Django mutation, manage optional quantity with defaults, and use an atomic transaction to ensure data integrity.
Learn to manage many-to-many relationships in Django GraphQL Strawberry by creating records and linking related objects via a through table, including users, orders, and products with quantities.
Learn to update a single product record using flat fields, choosing between full updates and later partial updates, by locating by ID and saving new values with a GraphQL mutation.
Create a partial update input with a mandatory ID and optional fields to update only the specified product attributes using the product partial update mutation, optionally returning the updated product.
Learn to safely update products with foreign keys by validating category existence before saving, handling missing or invalid relationships, and validating updates via the product update mutation.
Update a many-to-many relationship by deleting and recreating order product links within a transaction, using product IDs and quantities to add, remove, or replace items.
Learn how to delete a single category with a GraphQL mutation in Django GraphQL Strawberry, handle on delete cascade, soft delete options, and return a delete status message.
Explore querying data with GraphQL in a Django environment, from simple queries to arguments, relationships, sorting, and pagination, with data loading for ready Docker queries.
Learn how to seed a PostgreSQL database in a dockerized Django project, using an initialization script and CSV data to create tables and populate related data for learning queries.
Learn to add arguments to GraphQL queries and write them by hand, building resolvers, category queries, and a schema with strawberry in a Django context, enabling precise data retrieval.
Explore filtering GraphQL results with a where argument in Strawberry Django, using an optional category filter on is active and name to return targeted data.
Learn to implement a flexible order by argument in a Django GraphQL app, sorting category queries by a chosen field in ascending or descending order with input validation.
Discover how to retrieve the first or last record in Django GraphQL with strawberry, via a first last input and order by, for flexible category and product filters.
Learn to count records in a GraphQL query and return both the total and the records using a category list with count type.
Build a basic pagination system for a GraphQL query using offset and limit, driven by a page input, returning a product list and total count.
Query related data in GraphQL with Django and Strawberry by exposing foreign keys in product and category, using nested types, and relying on select related optimization instead of manual joins.
Learn to set up and query many-to-many relationships in Django with strawberry GraphQL, exposing reverse foreign keys and nested types, and efficiently fetch related users and products in orders.
Explore tools and methods to build effective, flexible filtering logic and create filters that are easy to combine, adjust, and reuse for data queries, user inputs, and decision making logic.
Apply greater than, less than, greater than or equal to, and less than or equal to operators in Django GraphQL strawberry to filter by price.
Learn to implement and/or logic using queue objects in Django to combine multiple filtering conditions into clear, flexible queries that can be extended with category filters.
Discover pattern matching in django to filter data by partial string matches using i contains and i starts with, enabling case-insensitive, flexible search filters in a qobject filter chain.
Learn set membership filtering in Django using the in lookup to match a field against multiple values, enabling efficient, flexible GraphQL queries with lists of IDs.
Master aggregation and grouping to compute counts, sums, averages, and min and max values, group data to apply aggregates per group using annotate and having conditions for efficient, focused queries.
Explore Django ORM aggregation with count, sum, and average to summarize data in the database, then expose totals and averages in a strawberry GraphQL product summary.
Discover how to use Django's min and max aggregations on a filtered queryset to quickly retrieve the smallest and largest values, then expose them via a Strawberry GraphQL API.
Explore Django's annotate to group records and apply aggregates like count, sum, and average. See how to count products per category and expose results via a GraphQL strawberry API.
Explore filtering grouped data in Django using annotate and filter, with post-aggregation conditions converted to SQL having clauses; apply min products thresholds to category counts.
Welcome to Python Django GraphQL Strawberry Query Fundamentals — the course designed to give you a strong, practical foundation in building GraphQL APIs using Django ORM and Strawberry.
In this course, you’ll learn how to define Django models, create and query data, build GraphQL types and resolvers, and connect your backend to a fully working GraphQL schema. We’ll explore essential techniques like filtering, aggregating, composing complex queries, optimizing query performance, and structuring clean, scalable schemas.
You’ll also dive into key GraphQL fundamentals like types, inputs, field-level resolvers, pagination, sorting, and handling many-to-many relationships. Along the way, we'll implement best practices for containerized development using Docker, VSCode setup, Django Admin customization, and automated project management for a smooth developer workflow.
Whether you’re starting with Django or looking to add GraphQL to your skillset, this course focuses on clear, hands-on guidance. Each module builds on the last, giving you a complete, end-to-end project experience you can use to grow your real-world skills.
What you’ll need:
Basic Python knowledge is recommended. No prior experience with Django ORM, GraphQL, or Strawberry is required — we’ll cover all the key concepts step-by-step. Just bring your willingness to learn!
Let's get started and build it together!
Student Prerequisites
Basic understanding of Python (variables, functions, classes)
Familiarity with using a code editor like VSCode
Comfortable running basic commands in the terminal or command prompt
An interest in learning Django ORM and GraphQL (no prior experience needed)
Willingness to set up development tools (VSCode, Docker, PostgreSQL)
Enthusiasm to learn step-by-step and practice through guided exercises