Maintainer Notes: Fixture metadata survives merge
Status: Fixture
GAP-1004: @cost Directive
Version: Draft
Authors: Priya Santos
Discussion: github.com/graphql/gaps/pull/1004
GAP-1004: @cost Directive
This document defines a directive for declaring approximate execution cost in a GraphQL schema.
1Overview
The directive MAY appear on field definitions.
Example № 1directive @cost(value: Int!, multipliers: [String!] = []) on FIELD_DEFINITION
2Motivation
GraphQL services can expose expensive fields. Shared cost hints let tools make conservative decisions before an operation is executed.
3Semantics
The value argument is an abstract relative cost. Implementations SHOULD NOT interpret it as milliseconds, memory, or any other physical unit.