
What technologies we will use in this tutorial: Django, GraphQL, Graphene, Python, PyCharm
What is GraphQL
Apply pending migrations with python manage.py migrate to enable the built-in django admin. Create a superuser with manage.py createsuperuser, then log in to manage users and data.
Create a movie model in Django with a title char field and year integer field, set a default 2000, register it in admin, and apply migrations to populate the database.
Learn how to model a movie and a director in Django, connect them with a foreign key and on_delete rules, define a string representation, and run migrations.
Learn how to add Graphene to a Django app, wire up models for movies and directors, configure a base schema, and expose a GraphQL endpoint with GraphiQL.
Learn to use the GraphiQL interface in Django to write queries like all movies, select fields such as title and year, and view the resulting JSON data.
Learn to query a single movie in a Django GraphQL project using Graphene, with id or title parameters, alongside existing list queries.
Learn to add a dynamic custom field to the movie type in GraphQL with Django, using a resolve function to compute movie age as old or new based on year.
Learn to fetch data with GraphQL from a Django database, add a director type to query multiple models, select subfields, and optimize queries to avoid overfetching and underfetching.
Learn how to fetch multiple movies in a single GraphQL query by using aliases and fragment spreads to share fields across queries.
Name GraphQL queries for easier debugging and readability, use variables to make queries dynamic, and apply include and skip directives to conditionally fetch fields such as movies and directors.
Learn to use mutation alongside query in Django with Graphene to create a movie record, define arguments, return id, title, and year, and update the base schema.
Create a movie update mutation in Graphene for GraphQL, requiring an id and optional title or year, update the movie, save, and return the updated record.
Create a movie delete mutation that accepts only the id and removes the movie from the database, with GraphQL queries confirming its absence.
Extend a django graphql project with jwt authentication by installing django graphql jwt, configuring middleware and authentication classes, and enabling token-based login through obtain json web token.
Discover how Relay, a data driven framework powered by GraphQL, streamlines Django GraphQL queries by using Relay node types, edges, and built in filtering with Django filter connection field.
Explore relay with Django GraphQL to query movies using per-field filters. Enable exact, contains, and starts with filters using a Django filter connection field for title and year.
Explore relay mutations in Django Graphene: convert global IDs, use input objects for updates, and return payloads with mutate and get payload, illustrated by updating a movie record.
Explore relay-based pagination in Django with GraphQL, using first and last limits, end cursors, after and before navigation, and page info to manage edges and nodes.
Learn how introspection schema defines query and mutation operations, generate a schema.json for front-end clients with a single manage.py graphql_schema command, and choose its output path.
Set up a React app with a GraphQL client, write a first get movies query using gql, and fetch data with the useQuery hook to display movie titles.
Learn how to integrate Apollo client with Angular, configure the GraphQL module and uri, and run the Angular server to fetch a movie list similar to the React approach.
Concludes the Django with GraphQL course by detailing how to create the API and front-end options with Angular or React. Explore related full-stack courses on Udemy with the coupon max_off.
We will learn what is GraphQL, what are pros and cons of using it. We will talk about the main concept in GraphQL like schemas, types, queries, mutations and subscriptions.
In the first section we will create plain Django project. This is introduction to Django framework and none previous knowledge is required.
Once the project will be setup we will add GraphQL. In that way you will be able to follow along with either your own Django project or simple project we have created together in the first section. I will explain how to create a root schema and how to create schemas for apps. Also we will implement new Django url to use graphiql: the UI to perform or queries and mutations. Once GraphQL is ready we will add Types, Queries and Mutations. I will show you different ways to write these and explain why we might use one option over another.
After we will have a solid understanding of the GraphQL and how it is connected with Django, we will dive deeper and add some extras like: Token Authentication (JWT), Relay implementations, Filters, Pagination etc.
We will finish the course with the samples how to use our backend GraphQL API with front end applications based on both React and Angular. We will have 2 separate application that will fetch data from our Django Database using our graphql API. We will use apollo library on the front end.