feat: fragment-arguments execution#6013
Closed
JoviDeCroock wants to merge 5 commits intoardatan:masterfrom
Closed
Conversation
|
845da80 to
6c57de1
Compare
7dc8688 to
c1b4b27
Compare
JoviDeCroock
commented
Apr 3, 2024
| variableValues?: { [variable: string]: unknown }, | ||
| ) { | ||
| // TODO: figure out how to do custom parser here | ||
| const document = parse(query, { experimentalFragmentArguments: true }); |
Author
There was a problem hiding this comment.
This is pending, how do we want to tackle having an alternative parser?
JoviDeCroock
commented
Apr 3, 2024
JoviDeCroock
commented
Apr 3, 2024
| addPathSegmentInfo(type, fieldName, newPathIndex, fieldErrors, errorInfo); | ||
| } | ||
|
|
||
| // TODO: for fragment arguments we might need to update the variable-values here. |
Author
There was a problem hiding this comment.
Wasn't sure here as I don't know some of these utils, looking deeper atm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This implements the changes in execution required for the Fragment-Arguments spec proposed in graphql/graphql-spec#1081. This could be a way towards us testing this feature out in implementations like Yoga, ... We could publish it under a
experimental-fragment-argumentstag.I was trying to figure out how we could best either introduce a custom parser like we have in 0no-co/graphql.web#23 or use a branch of
graphql-js. This mainly so we can run the tests 😅 the tests are currently copied fromgraphql-jsin JoviDeCroock/graphql-js#2 and graphql/graphql-js#4015.The changes for validation are still left open purposefully as that is the part of the spec I've gotten least feedback on. The main point that's open is whether we disallow spreads on the same fragment with different arguments, as there is currently no way to alias a fragment.
Not sure whether I did something wrong but it tells me that memoize3 isn't a function 😅
Type of change
How Has This Been Tested?
I have added tests in
variables-test.tsand still have to add tests for overall execution from an integration point of view.Checklist:
CONTRIBUTING doc and the
style guidelines of this project