GAP-1003: @streamPolicy Directive
Version: Draft
Authors: Nia Patel, Jon Bell
Discussion: github.com/graphql/gaps/pull/1003

GAP-1003: @streamPolicy Directive

This document defines a directive for annotating fields that are commonly delivered incrementally.

1Overview

The directive identifies a delivery preference that clients and gateways can use for planning.

Example № 1directive @streamPolicy(
  mode: StreamMode!
  ordered: Boolean = true
) on FIELD_DEFINITION

enum StreamMode {
  LOW_LATENCY
  BALANCED
  COMPLETE
}

2Motivation

Some fields are useful before the rest of the response has completed. Schema authors need a way to make that intent visible without binding the schema to a single transport.

3Semantics

A server MAY ignore the directive when a transport does not support incremental delivery.

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