Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fragment args 2024 amendments #3

Conversation

JoviDeCroock
Copy link

@JoviDeCroock JoviDeCroock commented Feb 7, 2024

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 on X ($a: String!, $b: String!) {
  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 on X ($b: String!) {
  ## 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.

Not sure how to call GraphQL WG reviewers here 😅

dugenkui03 and others added 8 commits February 2, 2023 11:08
Co-authored-by: Benjie Gillam <benjie@jemjie.com>
Clarify that a schema definition must be present (and not omitted) if a default root type name happens to be used by a type which is not a root type.

Also adds an editorial change to introduce term definitions for the immediate concepts involved.

Co-authored-by: Lee Byron <lee@leebyron.com>
…raphql#1009)

Adds how to contribute custom scalar specs, links to spec templates, and adds examples following the launch of https://scalars.graphql.org

Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Roman Ivantsov <roman.ivantsov@microsoft.com>
@JoviDeCroock JoviDeCroock force-pushed the fragment-args-2024-amendments branch from 5a73543 to d7590fa Compare March 8, 2024 07:04
@JoviDeCroock JoviDeCroock force-pushed the fragment-args-2024-amendments branch from ac9fdbc to 03ba255 Compare March 27, 2024 13:39
JoviDeCroock and others added 4 commits March 29, 2024 11:25
@JoviDeCroock
Copy link
Author

Closing as there's a PR open on the main spec repo

JoviDeCroock added a commit to graphql/graphql-js that referenced this pull request Sep 6, 2024
This is a rebase of #3847

This implements execution of Fragment Arguments, and more specifically
visiting, parsing and printing of fragment-spreads with arguments and
fragment definitions with variables, as described by the spec changes in
graphql/graphql-spec#1081. There are a few
amendments in terms of execution and keying the fragment-spreads, these
are reflected in mjmahone/graphql-spec#3

The purpose is to be able to independently review all the moving parts,
the stacked PR's will contain mentions of open feedback that was present
at the time.

- [execution changes](JoviDeCroock#2)
- [TypeInfo & validation
changes](JoviDeCroock#4)
- [validation changes in
isolation](JoviDeCroock#5)


CC @mjmahone the original author

---------

Co-authored-by: mjmahone <mahoney.mattj@gmail.com>
Co-authored-by: Yaacov Rydzinski <yaacovCR@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants