liveBook · Manning

GraphQL

As explained in Django in Action

GraphQL is a query language and API runtime in which clients specify the data and operations they want through a schema-defined query.

GraphQL is a non-REST API approach where one endpoint accepts a JSON-like document describing the requested query. Clients choose the data and operations they need through a schema, avoiding multiple URL endpoints and HTTP methods that act as verbs. section 11.3

A Django GraphQL interface typically combines:

  • Graphene schemas that define returned data and map it to the ORM. section 11.3
  • Query classes that define available actions, including operations corresponding to CRUD. section 11.3
  • A GraphQLView registered as the single API endpoint. section 11.3

Selective responses

A client can request an object while limiting the returned data to selected fields, much like limiting an SQL response to chosen columns. This flexibility can reduce bandwidth usage. section 11.3

How Django in Action covers it

How deep it goes
Explains the endpoint, schemas, ORM mapping, and query classes, but stops short of detailed implementation or query syntax.
Examples
Uses Graphene schemas, query classes, GraphQLView registration, and selectively requested object fields as concrete artifacts.
What you can do after
Evaluate GraphQL architecture and identify how a Django API exposes schemas, operations, and client-selected responses.
How it connects
Connects schemas and query classes with Django, the ORM, CRUD operations, REST, HTTP methods, and SQL-style field selection.

Also explained in

Compare how 6 books explain GraphQL →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Django in Action. The section links point to the parts of the book it draws on.