GAP-1005: @redact Directive
Version: Draft
Authors: Sam Rivera, Keiko Morgan
Discussion: github.com/graphql/gaps/pull/1005

GAP-1005: @redact Directive

This document defines a directive for marking schema fields whose values should be masked outside the execution result.

1Overview

The directive MAY appear on field definitions and input field definitions.

Example № 1directive @redact(
  reason: String
  mode: RedactionMode = MASK
) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION

enum RedactionMode {
  MASK
  HASH
  DROP
}

2Motivation

Logs and traces are often copied between systems. A schema-level redaction hint lets operational tools avoid retaining sensitive values unnecessarily.

3Semantics

The directive does not change authorization or execution semantics. It only describes how values should be handled outside the response contract.

  1. 1Overview
  2. 2Motivation
  3. 3Semantics