Skip to content

Handle arguments only once per field#1706

Merged
spawnia merged 41 commits intomasterfrom
optimize-nested-field-argument-handling
Feb 21, 2023
Merged

Handle arguments only once per field#1706
spawnia merged 41 commits intomasterfrom
optimize-nested-field-argument-handling

Conversation

@spawnia
Copy link
Copy Markdown
Collaborator

@spawnia spawnia commented Jan 27, 2021

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Resolves #1699

Changes

As described by @k0ka in #1699, argument handling is quite expensive and happens not only once per field but once per resolved value for that field. We should aim to:

  • make the handling itself more efficient
  • only do handling if necessary at all
  • handle the arguments only once per field (not for every value/instance of that field)

Breaking changes

Yes, FieldMiddleware and FieldResolver directives now work significantly different.

@spawnia spawnia marked this pull request as draft February 3, 2021 22:30
@spawnia spawnia added the performance Fix or optimization of performance label Dec 30, 2021
# Conflicts:
#	src/Execution/BatchLoader/BatchLoaderRegistry.php
#	src/GraphQL.php
#	src/Schema/Directives/ArgTraversalDirective.php
#	src/Schema/Directives/RenameArgsDirective.php
#	src/Schema/Directives/SpreadDirective.php
#	src/Schema/Directives/TrimDirective.php
#	src/Schema/Factories/FieldFactory.php
#	src/Schema/Values/FieldValue.php
#	src/Validation/ValidateDirective.php
@spawnia spawnia marked this pull request as ready for review February 20, 2023 10:52
@spawnia spawnia merged commit 37b24a0 into master Feb 21, 2023
@spawnia spawnia deleted the optimize-nested-field-argument-handling branch February 21, 2023 09:43
spawnia added a commit that referenced this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Fix or optimization of performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move argumentSet/argumentSetFactory to a middleware

1 participant