-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
Compose complex input arguments through nested arg resolvers #899
Merged
Conversation
This file contains 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
… composable-input-arguments
# Conflicts: # src/Schema/Factories/ArgumentFactory.php
… composable-input-arguments # Conflicts: # src/Schema/Factories/ArgumentFactory.php
…ents # Conflicts: # src/Schema/Factories/ArgumentFactory.php
# Conflicts: # composer.json # src/Schema/Factories/ArgumentFactory.php # src/Schema/Factories/FieldFactory.php
# Conflicts: # src/Execution/Arguments/TypedArgs.php # src/Schema/Factories/ArgumentFactory.php # src/Schema/Factories/FieldFactory.php # tests/Unit/Execution/Arguments/TypedArgsTest.php
# Conflicts: # _ide_helper.php # src/Schema/Directives/CreateDirective.php # src/Schema/Factories/FieldFactory.php
# Conflicts: # tests/Integration/Schema/Directives/CreateDirectiveTest.php # tests/Unit/Execution/Arguments/ArgumentSetTest.php
4 tasks
spawnia
changed the title
WIP: Composable input arguments
Compose complex input arguments through nested arg resolvers
Dec 13, 2019
# Conflicts: # src/Schema/Directives/ModifyModelExistenceDirective.php
After dog-fooding this PR for a few weeks and giving it some final polish, this feature is finally ready. I am excited for people to try it, it has allowed us to compose functionality and DRY up a lot of extra code. |
3 tasks
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.
Related Issue/Intent
Resolves #725
Resolves #1038
Changes
The basic idea behind this is to allow complex nested input to be resolved in a composable fashion, similar to how field resolvers work.
Field arguments may have a resolver attached to them which gets then called with the corresponding slice of the given inputs. It runs after the parent resolver.
Added the capability to run the following directives as nested argument resolvers:
@create
@update
@upsert
@delete
This also adds the
@nest
argument resolver, which is basically a no-op resolver, used to contain multiple other nested argument resolvers in a single input object.Breaking changes
No, but let's test this one thoroughly before releasing it.
The
MutationExecutor
was split up into separate nested argument resolvers under the hood, but works just like before for application developers.