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

fix(federation): merge errors for shared root fields correctly #6355

Merged
merged 5 commits into from
Jul 18, 2024

Conversation

ardatan
Copy link
Owner

@ardatan ardatan commented Jul 18, 2024

Handle errors coming from subgraphs correctly when a root field is shared by different subgraphs

  • If subgraph A returns an error for Query.foo, and subgraph B returns the data, ignore the error and keep it for null fields.
  • If both subgraphs return errors, return them as AggregateError then return them to the gateway result.

Copy link

changeset-bot bot commented Jul 18, 2024

🦋 Changeset detected

Latest commit: 7fe3587

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@graphql-tools/federation Patch
federation-benchmark Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jul 18, 2024

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.........................: 100.00% ✓ 324      ✗ 0  
     data_received..................: 38 MB   3.8 MB/s
     data_sent......................: 139 kB  14 kB/s
     http_req_blocked...............: avg=4.06µs   min=2.02µs   med=2.68µs   max=179.99µs p(90)=3.92µs   p(95)=4.22µs  
     http_req_connecting............: avg=716ns    min=0s       med=0s       max=116.09µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=57.53ms  min=48.97ms  med=54.02ms  max=156.29ms p(90)=63.16ms  p(95)=87.68ms 
       { expected_response:true }...: avg=57.53ms  min=48.97ms  med=54.02ms  max=156.29ms p(90)=63.16ms  p(95)=87.68ms 
     http_req_failed................: 0.00%   ✓ 0        ✗ 162
     http_req_receiving.............: avg=142.59µs min=106.85µs med=134.49µs max=382.91µs p(90)=160.12µs p(95)=173.66µs
     http_req_sending...............: avg=26.02µs  min=19.78µs  med=24.68µs  max=93.27µs  p(90)=30.67µs  p(95)=36.91µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=57.36ms  min=48.81ms  med=53.87ms  max=155.93ms p(90)=63.02ms  p(95)=87.52ms 
     http_reqs......................: 162     16.17489/s
     iteration_duration.............: avg=61.8ms   min=52.96ms  med=58.19ms  max=160.21ms p(90)=68.33ms  p(95)=91.57ms 
     iterations.....................: 162     16.17489/s
     vus............................: 1       min=1      max=1
     vus_max........................: 1       min=1      max=1

Copy link
Contributor

github-actions bot commented Jul 18, 2024

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-tools/executor-http 1.1.5-alpha-20240718123353-7fe3587eed6cb8a9f672a63184b5acaede6538e5 npm ↗︎ unpkg ↗︎
@graphql-tools/federation 2.1.2-alpha-20240718123353-7fe3587eed6cb8a9f672a63184b5acaede6538e5 npm ↗︎ unpkg ↗︎

Copy link
Contributor

github-actions bot commented Jul 18, 2024

💻 Website Preview

The latest changes are available as preview in: https://2697a53f.graphql-tools.pages.dev

@ardatan ardatan force-pushed the aggregate-error-merge branch 2 times, most recently from bdbed92 to 43ca38c Compare July 18, 2024 11:46
enisdenjo added a commit that referenced this pull request Jul 18, 2024
@ardatan ardatan merged commit c6d175b into master Jul 18, 2024
29 checks passed
@ardatan ardatan deleted the aggregate-error-merge branch July 18, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants