Skip to main content

Trusted documents (operation allowlist)

Trusted documents allow only pre-registered operations to execute, reducing attack surface and enabling predictable performance.

Practices implemented

Applies to

  • GraphQL clients
  • GraphQL servers
  • Gateways and proxies
  • Schema registries and build tooling

Configuration (suggested defaults)

ParameterDefaultNotes
modeallowlistReject unknown operations by default.
documentIdAlgorithmsha256Stable hashing for IDs.
unknownDocumentBehaviorrejectError on unknown IDs.
persistedDocumentStorerequiredServer-side operation store must be configured.

Implementation notes

  • Clients upload operations during build or release.
  • Servers accept only a document ID, then look up the stored operation.
  • Maintain a migration path (for example, mode: hybrid) for existing traffic.

Cautions

  • Third-party APIs may need to opt out or run in hybrid mode.
  • Align client and server hash algorithms and canonicalization.
  • Ensure tooling can safely roll back or revoke documents.

Problems addressed