graphql-tools
graphql-tools copied to clipboard
feat: fragment-arguments execution
Description
This implements the changes in execution required for the Fragment-Arguments spec proposed in https://github.com/graphql/graphql-spec/pull/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 https://github.com/0no-co/graphql.web/pull/23 or use a branch of graphql-js
. This mainly so we can run the tests 😅 the tests are currently copied from graphql-js
in https://github.com/JoviDeCroock/graphql-js/pull/2 and https://github.com/graphql/graphql-js/pull/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
- [x] New feature (non-breaking change which adds functionality)
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:
- [x] I have followed the CONTRIBUTING doc and the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests and linter rules pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules