Skip to content
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

feature: batch support for resolving federation requests #306

Merged
merged 2 commits into from
Aug 27, 2019

Conversation

dariuszkuc
Copy link
Collaborator

@dariuszkuc dariuszkuc commented Aug 20, 2019

NOTE: This is a non-backwards compatible change as FederatedTypeResolver resolve signature is changed to process list of representations at once. This allows resolver to either instantiate entities one by one or use some batch logic.

Update _entities query resolver logic to resolve federation requests in batch mode. Specified federated object representations are grouped by the underlying typename and asynchronously resolved in batches. Batch results are then merged into a single list that preserves the original order of entities. If entity cannot be resolved, NULL will be returned instead. Any exceptions thrown while attempting to resolve the federated types will be returned together with partially resolved data.

@dariuszkuc dariuszkuc changed the title [WIP] feature: batch support for resolving federation requests feature: batch support for resolving federation requests Aug 24, 2019
@dariuszkuc dariuszkuc marked this pull request as ready for review August 24, 2019 03:34
@smyrick smyrick added changes: major Changes require a major version type: bug Something isn't working type: enhancement New feature or request and removed type: bug Something isn't working labels Aug 26, 2019
@codecov
Copy link

codecov bot commented Aug 26, 2019

Codecov Report

Merging #306 into master will decrease coverage by 0.88%.
The diff coverage is 77.35%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #306      +/-   ##
============================================
- Coverage     94.44%   93.56%   -0.89%     
- Complexity      256      267      +11     
============================================
  Files            74       76       +2     
  Lines           918      963      +45     
  Branches        169      176       +7     
============================================
+ Hits            867      901      +34     
- Misses           31       36       +5     
- Partials         20       26       +6
Impacted Files Coverage Δ Complexity Δ
...hql/federation/exception/InvalidFederatedSchema.kt 100% <ø> (ø) 1 <0> (?)
...phql/federation/execution/FederatedTypeRegistry.kt 100% <ø> (ø) 2 <0> (?)
...dia/graphql/federation/FederatedSchemaValidator.kt 93.5% <ø> (ø) 47 <0> (ø) ⬇️
...ql/federation/exception/InvalidFederatedRequest.kt 100% <100%> (ø) 4 <4> (?)
...raphql/federation/FederatedSchemaGeneratorHooks.kt 100% <100%> (+2.17%) 7 <0> (ø) ⬇️
...ql/federation/exception/FederatedRequestFailure.kt 28.57% <28.57%> (ø) 2 <2> (?)
...dia/graphql/federation/execution/EntityResolver.kt 82.92% <82.92%> (ø) 6 <6> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ec9140...09db5e2. Read the comment docs.

NOTE: This is a non-backwards compatible change as FederatedTypeResolver resolve signature is changed to process list of representations at once. This allows resolver to either instantiate entities one by one or use some batch logic.

Update _entities query resolver logic to resolve federation requests in batch mode. Specified federated object representations are grouped by the underlying typename and asynchronously resolved in batches. Batch results are then merged into a single list that preserves the original order of entities. If entity cannot be resolved, NULL will be returned instead. Any exceptions thrown while attempting to resolve the federated types will be returned together with partially resolved data.
@smyrick smyrick merged commit 34f024e into ExpediaGroup:master Aug 27, 2019
@dariuszkuc dariuszkuc deleted the federation_batch branch August 27, 2019 20:17
@dariuszkuc
Copy link
Collaborator Author

Resolves #298

smyrick pushed a commit to smyrick/graphql-kotlin that referenced this pull request Sep 11, 2019
…p#306)

* feature: batch support for resolving federation requests

NOTE: This is a non-backwards compatible change as FederatedTypeResolver resolve signature is changed to process list of representations at once. This allows resolver to either instantiate entities one by one or use some batch logic.

Update _entities query resolver logic to resolve federation requests in batch mode. Specified federated object representations are grouped by the underlying typename and asynchronously resolved in batches. Batch results are then merged into a single list that preserves the original order of entities. If entity cannot be resolved, NULL will be returned instead. Any exceptions thrown while attempting to resolve the federated types will be returned together with partially resolved data.

* additional test for invalid result size
dariuszkuc added a commit to dariuszkuc/graphql-kotlin that referenced this pull request Aug 5, 2022
…p#306)

* feature: batch support for resolving federation requests

NOTE: This is a non-backwards compatible change as FederatedTypeResolver resolve signature is changed to process list of representations at once. This allows resolver to either instantiate entities one by one or use some batch logic.

Update _entities query resolver logic to resolve federation requests in batch mode. Specified federated object representations are grouped by the underlying typename and asynchronously resolved in batches. Batch results are then merged into a single list that preserves the original order of entities. If entity cannot be resolved, NULL will be returned instead. Any exceptions thrown while attempting to resolve the federated types will be returned together with partially resolved data.

* additional test for invalid result size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: major Changes require a major version type: enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants