DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
graphql.h File Reference

Zero-heap GraphQL query subset - parser + executor (DETWS_ENABLE_GRAPHQL). More...

#include "ServerConfig.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

Zero-heap GraphQL query subset - parser + executor (DETWS_ENABLE_GRAPHQL).

A small, deterministic GraphQL query engine for a constrained device: it parses a query document into a fixed AST node pool (no heap), then walks the selection set emitting a {"data":{...}} response that mirrors exactly the fields requested - the core GraphQL property (the client picks the shape).

Schema-free model. There is no separate schema: a field that carries a sub-selection (obj { a b }) is an object - the engine recurses and emits the nested object - and a field with no sub-selection is a leaf scalar, for which the engine calls your single resolver. Arguments encountered along the path (sensor(id: 2) { value }) are collected and handed to the leaf resolver, so a resolver for sensor.value can read id. The app implements one function: "the value of the scalar at this dotted path, given these args."

Supported: a single query operation (bare {...} or query [Name] {...}), nested selection sets, field arguments (int / float / string / bool / null), and insignificant commas. Out of scope (keeps it bounded + deterministic): mutations, subscriptions, fragments, variables, directives, aliases, lists of objects. Malformed input fails closed with {"errors":[...]}.

Pure and host-tested. Bounds are compile-time (DETWS_GQL_*); parsing and execution allocate nothing.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file graphql.h.