RFC 2 / Draft

Fragment arguments/variables (syntax/validation/execution)

Opened on
Updated on

At a glance

Project
GraphQL Spec
Identifier
#1081
Stage
RFC 2 / Draft
Champion
@JoviDeCroock
Updated
2026-11-28
Latest activity
4 commits pushed on
Source
Related RFCs

Pull request description

This spec contains amendments to https://github.com/graphql/graphql-spec/pull/1010, a diffed view is available at https://github.com/mjmahone/graphql-spec/pull/3.

These amendments are made from comments on the implementation PR and alterations from the new implementation

In general the biggest changes are that we introduce fragmentVariableValues which will be on the groupedFieldSet, these are derived from the arguments in scope of the fragmentDefinition where this field is used.

We introduce localFragmentVariables which as we are traversing down fragment-spreads are a coerced set of variables i.e.

query($b: String!, $c: String!) {
  field3(b: $b) ## uses b from variable-values
  ...A(a: "A", b: "B")
}

fragment A($a: String!, $b: String!) on X {
  field(a: $a) ## uses $a from localVariableValues
  field2(c: $c) ## we have access to variableValues so we take c from there
  ...B(b: $b) ## uses $b from localVariableValues
}

fragment B($b: String!) on X {
  ## This fragment has access to $b and $c but not to $a
  field4(b: $b) ## uses $b from localVariableValues
}

Last but not least we introduce getArgumentValuesFromSpread which looks at the spread and fragment-definition and establishes a coerced set of localVariableValues.


Timeline

November 2026

September 2026

November 2025

October 2025

September 2025

July 2025

June 2025

March 2025

February 2025

October 2024

September 2024

August 2024

June 2024

May 2024

March 2024

February 2024

January 2023