Skip to main content
Navigation
HomeTechnical ReferenceJournalGitHubGitHub
Sidebar — toggle document categories via the logo
Django GraphQL Starter — API Template

Django GraphQL Starter — API Template

April 10, 2021

Overview

Django GraphQL Starter is a boilerplate template for bootstrapping new Django GraphQL APIs. It wires up Graphene-Django for automatic GraphQL schema generation directly from Django models, removing the need to hand-write resolvers for standard operations.

The template ships with a basic Todo model demonstrating full CRUD through GraphQL mutations and queries, a test suite, and Docker support. It is also referenced by the terraform-aws-ci-cd project as the sample backend API for its CI/CD pipeline.


Key Features

  • Automatic schema generation: Graphene-Django generates the GraphQL schema from models
  • Full CRUD on Todo model: Queries and mutations for create, read, update, delete
  • Test setup: Pre-configured test suite
  • Docker support: Dockerfile for containerized development and deployment
  • Explicit schema definition: Schema documented in schema.graphql
  • Minimal bootstrapping: Clone, install requirements, and start building

Architecture

A single Django application exposing a GraphQL API. Graphene resolves requests against the Django ORM, with the schema defined in schema.graphql. The included Dockerfile makes the API easy to containerize and deploy.


Tech Stack

LayerTechnology
FrameworkDjango
GraphQLGraphene-Django
Schemaschema.graphql
LanguagePython
DeploymentDocker (Dockerfile)