At a glance
- Identifier: #1081
- Stage: RFC 2 / Draft
- Champion: @JoviDeCroock
- Latest activity: 1 commit pushed on 2025-11-28
- Spec PR: https://github.com/graphql/graphql-spec/pull/1081
- Related:
Spec PR 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
- Changing fragment-key to just be fragment-name https://github.com/graphql/graphql-js/pull/3835#discussion_r1101825832
- Removing the substitution logic and going closer to the
coercelogic we use in the general flow
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
- Commit pushed on 2025-11-28 by JoviDeCroock: Merge pull request #2 from benjie/fragments-editorial
- 12 commits pushed on 2025-11-27:
- benjie committed "{operation,fragment}-defined variable -> {operation,fragment} variable"
- benjie committed "Editorial"
- benjie committed "Correct algorithm and provide clarifying note"
- benjie committed "Do not allow merging of fragments referencing different variables"
- benjie committed "Split logic for fragment arguments from directive/field arguments"
- benjie committed "Consistency"
- benjie committed "Precision and clarity"
- benjie committed "Add examples and clarify wording/algorithm"
- benjie committed "Spec consistency"
- benjie committed "Editorial"
- benjie committed "Editorial"
- benjie committed "Fix algorithm mistake"
- 2 commits pushed on 2025-11-13:
- benjie committed "Merge branch 'main' into fragment-args-2024-amendments"
- benjie committed "Add missing grammar"
- Commit pushed on 2025-10-07 by JoviDeCroock: Merge branch 'main' into fragment-args-2024-amendments
- Commit pushed on 2025-09-10 by JoviDeCroock: Merge branch 'main' into fragment-args-2024-amendments
- 3 commits pushed on 2025-07-03:
- JoviDeCroock committed "Fixes"
- JoviDeCroock committed "Merge branch 'main' into fragment-args-2024-amendments"
- JoviDeCroock committed "Formatting"
- Commit pushed on 2025-07-02 by JoviDeCroock: Merge branch 'main' into fragment-args-2024-amendments
- Added to WG agenda on 2025-03-06
- Commit pushed on 2025-02-15 by JoviDeCroock: Partial update, rest depends on https://github.com/graphql/graphql-sp…
- Added to WG agenda on 2024-10-03
- Mentioned in WG notes on 2024-10-01
- Commit pushed on 2024-09-04 by JoviDeCroock: update validation
- Commit pushed on 2024-08-08 by JoviDeCroock: Merge branch 'main' into fragment-args-2024-amendments
- Mentioned in WG notes on 2024-08-01
- Commit pushed on 2024-06-11 by JoviDeCroock: Merge branch 'main' into fragment-args-2024-amendments
- Commit pushed on 2024-06-09 by JoviDeCroock: formatting
- 2 commits pushed on 2024-06-08:
- JoviDeCroock committed "wording"
- JoviDeCroock committed "Merge branch 'main' into fragment-args-2024-amendments"
- Commit pushed on 2024-06-06 by JoviDeCroock: Update spec/Section 5 -- Validation.md
- Added to WG agenda on 2024-06-06
- Commit pushed on 2024-06-04 by JoviDeCroock: Update spec/Section 5 -- Validation.md
- Mentioned in WG notes on 2024-06-01
- Commit pushed on 2024-05-23 by JoviDeCroock: fix formatting
- Commit pushed on 2024-05-17 by JoviDeCroock: Ensure variables are defined
- 5 commits pushed on 2024-05-16:
- JoviDeCroock committed "Apply suggestions from code review"
- JoviDeCroock committed "remove non standard hyphens"
- JoviDeCroock committed "address redundant if"
- JoviDeCroock committed "address logical or"
- JoviDeCroock committed "clarify example"
- 4 commits pushed on 2024-03-30:
- JoviDeCroock committed "formatting and expand examples"
- JoviDeCroock committed "add in undefined fragment"
- JoviDeCroock committed "unset instead of null"
- JoviDeCroock committed "shorten"
- 2 commits pushed on 2024-03-29:
- JoviDeCroock committed "Apply suggestions from code review"
- JoviDeCroock committed "Apply suggestions from code review"
- 2 commits pushed on 2024-03-27:
- JoviDeCroock committed "Apply Benjie's suggestions"
- JoviDeCroock committed "conciser validation"
- Commit pushed on 2024-03-26 by JoviDeCroock: Remove unused
$__UNSET - 2 commits pushed on 2024-03-08:
- JoviDeCroock committed "address validation comments"
- JoviDeCroock committed "address language comments"
- Added to WG agenda on 2024-03-07
- Mentioned in WG notes on 2024-03-01
- Commit pushed on 2024-02-27 by JoviDeCroock: Update spec/Section 2 -- Language.md
- Spec PR created on 2024-02-16 by JoviDeCroock
- Commit pushed on 2024-02-16 by JoviDeCroock: corrections
- Commit pushed on 2024-02-12 by JoviDeCroock: wording
- 2 commits pushed on 2024-02-07:
- JoviDeCroock committed "address https://github.com/graphql/graphql-js/pull/3835#discussion_r1…"
- JoviDeCroock committed "wip"
- Commit pushed on 2023-01-02 by mjmahone: RFC: Fragment Arguments