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

feat(2639): implement entity resolver #2693

Merged
merged 28 commits into from
Sep 24, 2024
Merged

Conversation

meskill
Copy link
Contributor

@meskill meskill commented Aug 14, 2024

Summary:

Implements Query._entities handler according to the doc

Please, note, I didn't add any special flags to the server and enable entity resolver if there any resolver on type. async_graphql enables the federation support either by flag or if the entity defined. docs

Caveats for current implementation:

  • @link operator conflicts with apollo federation's @link. To address this I'm disabling .add_directive(Link::directive_definition(generated_types)) in the config.rs
  • to be able to load the subgraph to apollo we need to provide all of our internal definitions. It's done for now explicitly in the _service handler. But the recommended approach from apollo is to load .graphql schema file and we need to provide the definitions in that case somehow
  • tailcall doesn't output to sdl unknown directives but that could be useful in case of apollo federation since user may want to use apollo directives to speficy loading logic.

Issue Reference(s):
Fixes #2639
/claim #2639

Build & Testing:

  • I ran cargo test successfully.
  • I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

  • I have added relevant unit & integration tests.
  • I have updated the documentation accordingly.
  • I have performed a self-review of my code.
  • PR follows the naming convention of <type>(<optional scope>): <title>

@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Aug 14, 2024
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 93.70315% with 42 lines in your changes missing coverage. Please review.

Project coverage is 87.83%. Comparing base (b0bcfcf) to head (866bc3d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/core/blueprint/operators/apollo_federation.rs 86.99% 16 Missing ⚠️
src/core/config/resolver.rs 33.33% 10 Missing ⚠️
src/core/config/transformer/subgraph.rs 97.85% 8 Missing ⚠️
src/core/valid/valid.rs 50.00% 3 Missing ⚠️
src/core/config/directives/federation.rs 0.00% 1 Missing ⚠️
src/core/config/directives/graphql.rs 75.00% 1 Missing ⚠️
src/core/config/directives/grpc.rs 75.00% 1 Missing ⚠️
src/core/config/directives/http.rs 75.00% 1 Missing ⚠️
src/core/ir/error.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2693      +/-   ##
==========================================
+ Coverage   87.15%   87.83%   +0.67%     
==========================================
  Files         253      263      +10     
  Lines       25585    26180     +595     
==========================================
+ Hits        22299    22994     +695     
+ Misses       3286     3186     -100     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

generated/.tailcallrc.schema.json Outdated Show resolved Hide resolved
tests/execution/apollo-federation-entities.md Outdated Show resolved Hide resolved
tests/execution/apollo-federation-entities-batch.md Outdated Show resolved Hide resolved
@meskill meskill changed the title feat(federation): implement entity resolver feat(2639): implement entity resolver Aug 15, 2024
Copy link

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot added state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. and removed state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. labels Aug 27, 2024
Copy link

github-actions bot commented Sep 1, 2024

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot removed the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Sep 6, 2024
Copy link

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot added state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. and removed state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. labels Sep 11, 2024
Copy link

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Sep 23, 2024
@github-actions github-actions bot removed the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Sep 23, 2024
src/core/ir/error.rs Outdated Show resolved Hide resolved
src/core/ir/model.rs Outdated Show resolved Hide resolved
@meskill meskill requested a review from tusharmath September 24, 2024 11:47
@tusharmath tusharmath merged commit c062058 into main Sep 24, 2024
35 checks passed
@tusharmath tusharmath deleted the feat/federation-entity-resolver branch September 24, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 Bounty claim type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Support for Apollo Federation in Tailcall
3 participants