execute is async-first and follows a defined sequence:
- Parse source into a document when needed.
- Select the requested operation.
- Validate the document against the schema.
- Coerce variables using GraphQL input rules.
- Collect fields across selections, fragments, aliases, and directives.
- Resolve sibling fields concurrently.
- Complete scalar, object, list, interface, and union values.
- Capture field errors and apply non-null propagation.
Info, and registered dependencies.
Permissions run before extension wrappers and the resolver.
The result preserves partial data where GraphQL nullability allows it. Pre-execution
errors return executed=False; runtime errors remain attached to an executed response.
Validation runs a broad rule set — fragment cycles, known and correctly-located
directives, possible fragment spreads, lone anonymous operation, name uniqueness, and
overlapping-fields-can-be-merged — alongside the type and argument checks. Beyond
execute, the same engine powers subscribe (an async
iterator of results per source event) and
execute_incremental (@defer / @stream
payloads), and an optional masking policy can replace unexpected resolver errors with
a generic message.