Skip to content

fix(federation): pass on operation directives to subgraph queries#5743

Merged
goto-bus-stop merged 5 commits intodevfrom
renee/ROUTER-558-operation-directives
Aug 2, 2024
Merged

fix(federation): pass on operation directives to subgraph queries#5743
goto-bus-stop merged 5 commits intodevfrom
renee/ROUTER-558-operation-directives

Conversation

@goto-bus-stop
Copy link
Member

@goto-bus-stop goto-bus-stop commented Jul 30, 2024

Requires #5753

This propagates the input operation's DirectiveList down to subgraph queries.

When the subgraph operations are built, we don't have access to the input operation. We have access to its selection set and directives list separately. To make sure we propagate variable definitions that are used inside the directive list of the operation, I adjusted the API of used_variables(), with all the visitor code in a VariableCollector struct that you can use to collect variables from multiple elements. This change also fixes a very, very minor hole in #5730, namely if there is a variable reference in a directive application on a named fragment definition.

@github-actions
Copy link
Contributor

@goto-bus-stop, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

@router-perf
Copy link

router-perf bot commented Jul 30, 2024

CI performance tests

  • const - Basic stress test that runs with a constant number of users
  • demand-control-instrumented - A copy of the step test, but with demand control monitoring and metrics enabled
  • demand-control-uninstrumented - A copy of the step test, but with demand control monitoring enabled
  • enhanced-signature - Enhanced signature enabled
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • events_big_cap_high_rate - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity
  • events_big_cap_high_rate_callback - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity using callback mode
  • events_callback - Stress test for events with a lot of users and deduplication ENABLED in callback mode
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • events_without_dedup_callback - Stress test for events with a lot of users and deduplication DISABLED using callback mode
  • extended-reference-mode - Extended reference mode enabled
  • large-request - Stress test with a 1 MB request payload
  • no-tracing - Basic stress test, no tracing
  • reload - Reload test over a long period of time at a constant rate of users
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • step-local-metrics - Field stats that are generated from the router rather than FTV1
  • step-with-prometheus - A copy of the step test with the Prometheus metrics exporter enabled
  • step - Basic stress test that steps up the number of users over time
  • xlarge-request - Stress test with 10 MB request payload
  • xxlarge-request - Stress test with 100 MB request payload

@duckki
Copy link
Contributor

duckki commented Jul 31, 2024

This is likely to fix some of the Rust QP errors.

@goto-bus-stop goto-bus-stop mentioned this pull request Jul 31, 2024
6 tasks
@goto-bus-stop goto-bus-stop enabled auto-merge (squash) July 31, 2024 13:11
Copy link
Contributor

@duckki duckki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code & test changes look great!

@goto-bus-stop goto-bus-stop merged commit 7d6c111 into dev Aug 2, 2024
@goto-bus-stop goto-bus-stop deleted the renee/ROUTER-558-operation-directives branch August 2, 2024 00:26
@duckki
Copy link
Contributor

duckki commented Aug 2, 2024

BTW, the "unused variable" regressions that I reported earlier has been fixed by #5753.

duckki added a commit that referenced this pull request Aug 2, 2024
- FetchNode's `variable_usages` field incorrectly included the "representations" variable.
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.

2 participants