-
-
Notifications
You must be signed in to change notification settings - Fork 819
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
feat: fragment-arguments execution #6013
Conversation
|
845da80
to
6c57de1
Compare
7dc8688
to
c1b4b27
Compare
variableValues?: { [variable: string]: unknown }, | ||
) { | ||
// TODO: figure out how to do custom parser here | ||
const document = parse(query, { experimentalFragmentArguments: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pending, how do we want to tackle having an alternative parser?
@@ -257,6 +256,7 @@ function visitObjectValue( | |||
addPathSegmentInfo(type, fieldName, newPathIndex, fieldErrors, errorInfo); | |||
} | |||
|
|||
// TODO: for fragment arguments we might need to update the variable-values here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't sure here as I don't know some of these utils, looking deeper atm
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-arguments
tag.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-js
in 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.ts
and still have to add tests for overall execution from an integration point of view.Checklist:
CONTRIBUTING doc and the
style guidelines of this project