├── .gitmodules ├── .ignore ├── examples ├── unix-sockets │ ├── .unixonly │ ├── router_unix.yaml │ └── README.md ├── context │ └── rust │ │ ├── .skipconfigvalidation │ │ ├── router.yaml │ │ └── Cargo.toml ├── async-auth │ └── rust │ │ ├── .skipconfigvalidation │ │ ├── allowedClientIds.json │ │ └── router.yaml ├── hello-world │ └── rust │ │ ├── .skipconfigvalidation │ │ ├── router.yaml │ │ └── README.md ├── custom-global-allocator │ └── .gitignore ├── supergraph-sdl │ └── rust │ │ ├── .skipconfigvalidation │ │ ├── router.yaml │ │ └── Cargo.toml ├── coprocessor-subgraph │ ├── rust │ │ ├── .skipconfigvalidation │ │ └── README.md │ └── nodejs │ │ ├── .gitignore │ │ ├── package.json │ │ └── README.md ├── forbid-anonymous-operations │ ├── rust │ │ ├── .skipconfigvalidation │ │ └── router.yaml │ └── rhai │ │ ├── README.md │ │ ├── router.yaml │ │ └── Cargo.toml ├── status-code-propagation │ └── rust │ │ ├── .skipconfigvalidation │ │ ├── router.yaml │ │ └── src │ │ └── main.rs ├── coprocessor-override-launchdarkly │ ├── .gitignore │ ├── .env │ └── router.example.yaml ├── graphql │ └── README.md ├── logging │ └── rhai │ │ ├── router.yaml │ │ ├── README.md │ │ └── Cargo.toml ├── cache-control │ └── rhai │ │ ├── router.yaml │ │ ├── README.md │ │ └── Cargo.toml ├── throw-error │ └── rhai │ │ ├── router.yaml │ │ ├── README.md │ │ └── Cargo.toml ├── op-name-to-header │ └── rhai │ │ ├── router.yaml │ │ ├── README.md │ │ └── Cargo.toml ├── add-timestamp-header │ └── rhai │ │ ├── router.yaml │ │ ├── README.md │ │ └── Cargo.toml ├── cookies-to-headers │ └── rhai │ │ ├── router.yaml │ │ ├── README.md │ │ └── Cargo.toml ├── data-response-mutate │ └── rhai │ │ ├── router.yaml │ │ ├── README.md │ │ └── Cargo.toml ├── subgraph-request-log │ └── rhai │ │ ├── router.yaml │ │ ├── README.md │ │ └── Cargo.toml ├── surrogate-cache-key │ └── rhai │ │ ├── router.yaml │ │ ├── README.md │ │ └── Cargo.toml ├── error-response-mutate │ └── rhai │ │ ├── router.yaml │ │ ├── README.md │ │ └── Cargo.toml ├── telemetry │ ├── otlp.router.yaml │ ├── datadog.router.yaml │ ├── zipkin-agent.router.yaml │ ├── jaeger-agent.router.yaml │ ├── zipkin-collector.router.yaml │ ├── jaeger-collector.router.yaml │ └── README.md ├── forbid-mutations │ ├── README.md │ └── router.yaml ├── coprocessor │ └── README.md ├── header-manipulation │ └── README.md └── jwt-claims │ └── rhai │ ├── router.yaml │ └── Cargo.toml ├── apollo-router ├── examples │ ├── .skipconfigvalidation │ └── router.yaml ├── src │ ├── configuration │ │ ├── testdata │ │ │ ├── true.txt │ │ │ ├── migrations │ │ │ │ ├── .skipconfigvalidation │ │ │ │ ├── subscription_enabled.yaml │ │ │ │ ├── defer_support_ga.router.yaml │ │ │ │ ├── health-check_to_health_check.router.yaml │ │ │ │ ├── persisted-queries-preview.yaml │ │ │ │ ├── batching.yaml │ │ │ │ ├── parser_recursion.router.yaml │ │ │ │ ├── http_max_request_bytes.router.yaml │ │ │ │ ├── operation-limits-preview.yaml │ │ │ │ ├── zipkin_enabled.router.yaml │ │ │ │ ├── datadog_enabled.router.yaml │ │ │ │ ├── trace_config.router.yaml │ │ │ │ ├── jaeger_enabled.router.yaml │ │ │ │ ├── query_plan_cache.yaml │ │ │ │ ├── telemetry_resources.router.yaml │ │ │ │ ├── telemetry_tracing_propagation_awsxray.router.yaml │ │ │ │ ├── telemetry_attributes.router.yaml │ │ │ │ ├── telemetry_otlp_timeout.router.yaml │ │ │ │ ├── otlp_enabled.router.yaml │ │ │ │ ├── jaeger_scheduled_delay.router.yaml │ │ │ │ ├── telemetry_router_to_supergraph.router.yaml │ │ │ │ ├── supergraph_apq_to_apq.router.yaml │ │ │ │ └── telemetry-exporters.router.yaml │ │ │ ├── config_basic.router.yaml │ │ │ ├── invalid_url.router.yaml │ │ │ ├── metrics │ │ │ │ ├── defer.router.yaml │ │ │ │ ├── authorization.router.yaml │ │ │ │ ├── batching.router.yaml │ │ │ │ ├── authorization_directives.router.yaml │ │ │ │ ├── query_planner_parallelism_auto.router.yaml │ │ │ │ ├── query_planner_parallelism_static.router.yaml │ │ │ │ ├── jwt.router.yaml │ │ │ │ ├── demand_control.router.yaml │ │ │ │ ├── sigv4.router.yaml │ │ │ │ ├── persisted_queries.router.yaml │ │ │ │ ├── limits.router.yaml │ │ │ │ ├── apq.router.yaml │ │ │ │ ├── entities.router.yaml │ │ │ │ ├── file_uploads.router.yaml │ │ │ │ └── subscriptions.router.yaml │ │ │ ├── config_full.router.yaml │ │ │ ├── supergraph_config.router.yaml │ │ │ ├── zipkin.router.yaml │ │ │ ├── tracing_datadog.router.yaml │ │ │ ├── zipkin-address.router.yaml │ │ │ ├── zipkin-url.router.yaml │ │ │ ├── zipkin-url_env.router.yaml │ │ │ ├── tracing_jaeger_agent.router.yaml │ │ │ ├── tracing_datadog_env.router.yaml │ │ │ ├── tracing_otlp_grpc_basic.router.yaml │ │ │ ├── tracing_otlp_http_basic.router.yaml │ │ │ ├── tracing_jaeger_collector.router.yaml │ │ │ ├── tracing_apollo.router.yaml │ │ │ ├── tracing_otlp_grpc_basic_env.router.yaml │ │ │ ├── tracing_apollo_env.router.yaml │ │ │ ├── tracing_jaeger_collector_env.router.yaml │ │ │ └── tracing_jaeger_full.router.yaml │ │ ├── snapshots │ │ │ ├── .skipconfigvalidation │ │ │ ├── apollo_router__configuration__tests__default_config_has_defaults.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@subscription_enabled.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@batching.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@defer_support_ga.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@operation-limits-preview.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@parser_recursion.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@persisted-queries-preview.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@health-check_to_health_check.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@http_max_request_bytes.router.yaml.snap │ │ │ ├── apollo_router__configuration__expansion__test__prefixed.snap │ │ │ ├── apollo_router__configuration__expansion__test__unprefixed.snap │ │ │ ├── apollo_router__configuration__tests__expansion_failure_missing_variable.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@query_plan_cache.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__custom_plugin.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@trace_config.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@defer.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__ignore_cloud_router_plugins.snap │ │ │ ├── apollo_router__configuration__tests__expansion_failure_unknown_mode.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@jwt.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@telemetry_attributes.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@telemetry_resources.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@sigv4.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@datadog_enabled.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@telemetry_tracing_propagation_awsxray.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@zipkin_enabled.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__license_halt.snap │ │ │ ├── apollo_router__configuration__metrics__test__license_warn.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@batching.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@jaeger_enabled.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@query_planner_parallelism_auto.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@query_planner_parallelism_static.router.yaml.snap │ │ │ ├── apollo_router__configuration__upgrade__test__upgrade_output.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@supergraph_apq_to_apq.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@authorization.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__line_precise_config_errors_with_sequence.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@telemetry_otlp_timeout.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@demand_control.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@file_uploads.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@authorization_directives.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@otlp_enabled.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@apq.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@entities.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@telemetry_router_to_supergraph.router.yaml.snap │ │ │ ├── apollo_router__configuration__tests__upgrade_old_configuration@jaeger_scheduled_delay.router.yaml.snap │ │ │ ├── apollo_router__configuration__upgrade__test__diff_upgrade_output.snap │ │ │ ├── apollo_router__configuration__tests__it_does_not_leak_env_variable_values.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@persisted_queries.router.yaml.snap │ │ │ ├── apollo_router__configuration__metrics__test__metrics@tls.router.yaml.snap │ │ │ └── apollo_router__configuration__tests__line_precise_config_errors_bad_type.snap │ │ └── migrations │ │ │ ├── 0006-apq.yaml │ │ │ ├── 0023-batching.yaml │ │ │ ├── 0005-health_check_snake.yaml │ │ │ ├── 0009-subscription-enabled.yaml │ │ │ ├── 0007-coprocessor_subgraph_url.yaml │ │ │ ├── 0010-auth-jwt.yaml │ │ │ ├── 0024-graphql_validation.yaml │ │ │ ├── 0019-authorization-ga.yaml │ │ │ ├── 0008-operation-limits-ga.yaml │ │ │ ├── 0022-query-planner-cache.yaml │ │ │ ├── 0004-defer_support_ga.yaml │ │ │ ├── 0012-persisted-queries-ga.yaml │ │ │ ├── 0014-telemetry_trace_config_common.yaml │ │ │ ├── 0015-telemetry_metrics_resource.yaml │ │ │ ├── 0016-telemetry_tracing_resource.yaml │ │ │ ├── 0017-propagation_aws_xray.yaml │ │ │ ├── 0003-otlp_timout.yaml │ │ │ ├── 0001-telemetry_router_to_supergraph.yaml │ │ │ ├── 0021-http-max-request-bytes-ga.yaml │ │ │ ├── 0002-jaeger_scheduled_delay.yaml │ │ │ ├── 0007-parser-recursion.yaml │ │ │ └── 0018-telemetry-instruments-exporters.yaml │ ├── uplink │ │ ├── testdata │ │ │ ├── override-manual-demo.yml │ │ │ ├── oss.router.yaml │ │ │ ├── schema_enforcement_spec_version_in_range.graphql │ │ │ └── schema_enforcement_spec_version_out_of_range.graphql │ │ ├── snapshots │ │ │ ├── apollo_router__uplink__license_stream__test__validate_no_claim@logs.snap │ │ │ ├── apollo_router__uplink__license_stream__test__validate_audience_single@logs.snap │ │ │ ├── apollo_router__uplink__license_stream__test__validate_audience_multiple@logs.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_invalid.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_failed_from_all.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_error_no_retry.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_failed_from_single.snap │ │ │ ├── apollo_router__uplink__license_enforcement__test__schema_enforcement_spec_version_in_range.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_fallback.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_round_robin.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_unchanged.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_error_retry.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_transforming_new_response_first_response_transform_fails.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_empty_http_fallback.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_empty_http_round_robin.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_error_http_fallback.snap │ │ │ ├── apollo_router__uplink__test__stream_from_uplink_error_http_round_robin.snap │ │ │ ├── apollo_router__uplink__license_stream__test__validate_audience_multiple_filtered@logs.snap │ │ │ ├── apollo_router__uplink__license_stream__test__validate_audience_single_filtered@logs.snap │ │ │ ├── apollo_router__uplink__license_enforcement__test__restricted_unix_socket_via_schema.snap │ │ │ └── apollo_router__uplink__license_enforcement__test__restricted_authorization_directives_via_schema.snap │ │ └── license.jwks.json │ ├── plugin │ │ └── test │ │ │ ├── mock │ │ │ └── mod.rs │ │ │ └── mod.rs │ ├── plugins │ │ ├── record_replay │ │ │ └── mod.rs │ │ ├── demand_control │ │ │ ├── cost_calculator │ │ │ │ ├── fixtures │ │ │ │ │ ├── basic_scalar_list_query.graphql │ │ │ │ │ ├── basic_mutation.graphql │ │ │ │ │ ├── basic_object_list_query.graphql │ │ │ │ │ ├── basic_object_query.graphql │ │ │ │ │ ├── basic_query.graphql │ │ │ │ │ ├── basic_interface_query.graphql │ │ │ │ │ ├── basic_skipped_query.graphql │ │ │ │ │ ├── federated_ships_required_query.graphql │ │ │ │ │ ├── basic_excluded_query.graphql │ │ │ │ │ ├── basic_nested_list_query.graphql │ │ │ │ │ ├── federated_ships_named_query.graphql │ │ │ │ │ ├── federated_ships_deferred_query.graphql │ │ │ │ │ ├── basic_union_query.graphql │ │ │ │ │ ├── federated_ships_deferred_response.json │ │ │ │ │ ├── federated_ships_inline_fragment_query.graphql │ │ │ │ │ ├── federated_ships_named_response.json │ │ │ │ │ ├── federated_ships_fragment_query.graphql │ │ │ │ │ └── federated_ships_required_response.json │ │ │ │ └── mod.rs │ │ │ ├── snapshots │ │ │ │ ├── apollo_router__plugins__demand_control__test__measure_on_execution_request.snap │ │ │ │ ├── apollo_router__plugins__demand_control__test__measure_on_execution_response.snap │ │ │ │ ├── apollo_router__plugins__demand_control__test__measure_on_subgraph_request.snap │ │ │ │ ├── apollo_router__plugins__demand_control__test__measure_on_subgraph_response.snap │ │ │ │ ├── apollo_router__plugins__demand_control__test__enforce_on_execution_request.snap │ │ │ │ ├── apollo_router__plugins__demand_control__test__enforce_on_execution_response.snap │ │ │ │ ├── apollo_router__plugins__demand_control__test__enforce_on_subgraph_request.snap │ │ │ │ └── apollo_router__plugins__demand_control__test__enforce_on_subgraph_response.snap │ │ │ └── fixtures │ │ │ │ ├── enforce_on_subgraph_request.router.yaml │ │ │ │ ├── enforce_on_execution_request.router.yaml │ │ │ │ ├── enforce_on_execution_response.router.yaml │ │ │ │ ├── enforce_on_subgraph_response.router.yaml │ │ │ │ ├── measure_on_subgraph_request.router.yaml │ │ │ │ ├── measure_on_execution_request.router.yaml │ │ │ │ ├── measure_on_execution_response.router.yaml │ │ │ │ └── measure_on_subgraph_response.router.yaml │ │ ├── cache │ │ │ ├── mod.rs │ │ │ └── snapshots │ │ │ │ ├── apollo_router__plugins__cache__tests__insert.snap │ │ │ │ ├── apollo_router__plugins__cache__tests__insert-3.snap │ │ │ │ ├── apollo_router__plugins__cache__tests__private-3.snap │ │ │ │ ├── apollo_router__plugins__cache__tests__no_cache_control-3.snap │ │ │ │ ├── apollo_router__plugins__cache__tests__no_cache_control-4.snap │ │ │ │ ├── apollo_router__plugins__cache__tests__no_cache_control.snap │ │ │ │ ├── apollo_router__plugins__cache__tests__insert-2.snap │ │ │ │ ├── apollo_router__plugins__cache__tests__insert-4.snap │ │ │ │ ├── apollo_router__plugins__cache__tests__private-2.snap │ │ │ │ ├── apollo_router__plugins__cache__tests__private.snap │ │ │ │ └── apollo_router__plugins__cache__tests__no_cache_control-2.snap │ │ ├── telemetry │ │ │ ├── config_new │ │ │ │ └── cost │ │ │ │ │ └── fixtures │ │ │ │ │ ├── cost_delta.router.yaml │ │ │ │ │ ├── cost_actual.router.yaml │ │ │ │ │ ├── cost_estimated.router.yaml │ │ │ │ │ ├── cost_delta_with_attributes.router.yaml │ │ │ │ │ ├── cost_actual_with_attributes.router.yaml │ │ │ │ │ └── cost_estimated_with_attributes.router.yaml │ │ │ ├── metrics │ │ │ │ └── snapshots │ │ │ │ │ ├── apollo_router__plugins__telemetry__metrics__apollo__test__apollo_metrics_parse_failure.snap │ │ │ │ │ ├── apollo_router__plugins__telemetry__metrics__apollo__test__apollo_metrics_validation_failure.snap │ │ │ │ │ ├── apollo_router__plugins__telemetry__metrics__apollo__test__apollo_metrics_multiple_operations.snap │ │ │ │ │ └── apollo_router__plugins__telemetry__metrics__apollo__test__apollo_metrics_exclude.snap │ │ │ ├── testdata │ │ │ │ ├── prometheus.router.yaml │ │ │ │ └── prometheus_custom_buckets.router.yaml │ │ │ ├── logging │ │ │ │ └── testdata │ │ │ │ │ └── experimental_when_header.router.yaml │ │ │ └── snapshots │ │ │ │ ├── apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_without_span_list.snap │ │ │ │ ├── apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_attributes.snap │ │ │ │ ├── apollo_router__plugins__telemetry__fmt_layer__tests__json_logging_attributes.snap │ │ │ │ └── apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_with_custom_events.snap │ │ ├── authorization │ │ │ └── snapshots │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__interface_typename-2.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__interface_typename-4.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__interface_type-7.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__scalar-2.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__query_field-2.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__query_field_alias-2.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__interface_type-9.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__extract_policies.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__interface_inline_fragment-2.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__filter_basic_query-8.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__filter_basic_query-6.snap │ │ │ │ ├── apollo_router__plugins__authorization__scopes__tests__extract_scopes.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__interface_typename.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__interface_field-3.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__interface_fragment-4.snap │ │ │ │ ├── apollo_router__plugins__authorization__policy__tests__interface_typename-3.snap │ │ │ │ ├── apollo_router__plugins__authorization__tests__unauthenticated_request.snap │ │ │ │ ├── apollo_router__plugins__authorization__authenticated__tests__mutation.snap │ │ │ │ ├── apollo_router__plugins__authorization__authenticated__tests__unauthenticated_request_defer.snap │ │ │ │ ├── apollo_router__plugins__authorization__tests__authenticated_request.snap │ │ │ │ ├── apollo_router__plugins__authorization__tests__scopes_directive-3.snap │ │ │ │ ├── apollo_router__plugins__authorization__tests__authenticated_directive-2.snap │ │ │ │ ├── apollo_router__plugins__authorization__authenticated__tests__authenticated_request.snap │ │ │ │ ├── apollo_router__plugins__authorization__authenticated__tests__interface_type.snap │ │ │ │ └── apollo_router__plugins__authorization__tests__scopes_directive_reject_unauthorized.snap │ │ └── traffic_shaping │ │ │ └── rate │ │ │ └── mod.rs │ ├── protocols │ │ └── mod.rs │ ├── axum_factory │ │ ├── testdata │ │ │ ├── log_on_broken_pipe.router.yaml │ │ │ ├── no_log_on_broken_pipe.router.yaml │ │ │ ├── span_mode_deprecated.router.yaml │ │ │ ├── span_mode_spec_compliant.router.yaml │ │ │ └── span_mode_default.router.yaml │ │ ├── snapshots │ │ │ ├── apollo_router__axum_factory__axum_http_server_factory__tests__request_cancel_no_log@logs.snap │ │ │ └── apollo_router__axum_factory__axum_http_server_factory__tests__request_cancel_log@logs.snap │ │ └── compression │ │ │ └── codec │ │ │ ├── brotli │ │ │ └── mod.rs │ │ │ ├── flate │ │ │ └── mod.rs │ │ │ ├── zstd │ │ │ └── mod.rs │ │ │ ├── deflate │ │ │ └── mod.rs │ │ │ └── gzip │ │ │ └── mod.rs │ ├── test_harness │ │ └── mocks │ │ │ └── mod.rs │ ├── testdata │ │ ├── supergraph_config.router.yaml │ │ ├── otlp.router.yaml │ │ ├── datadog.router.yaml │ │ └── zipkin.router.yaml │ ├── query_planner │ │ ├── testdata │ │ │ ├── unknown_introspection_query.graphql │ │ │ └── query.graphql │ │ └── snapshots │ │ │ ├── apollo_router__query_planner__labeler__tests__large_float_written_as_int.snap │ │ │ ├── apollo_router__query_planner__bridge_query_planner__tests__subselections.snap │ │ │ ├── apollo_router__query_planner__tests__defer_if_condition.snap │ │ │ ├── apollo_router__query_planner__tests__null_in_requires.snap │ │ │ ├── apollo_router__query_planner__tests__defer_if_condition-3.snap │ │ │ ├── apollo_router__query_planner__tests__alias_renaming.snap │ │ │ ├── apollo_router__query_planner__tests__alias_renaming-2.snap │ │ │ ├── apollo_router__query_planner__tests__missing_fields_in_requires.snap │ │ │ ├── apollo_router__query_planner__tests__missing_typename_and_fragments_in_requires.snap │ │ │ ├── apollo_router__query_planner__tests__missing_typename_and_fragments_in_requires2.snap │ │ │ ├── apollo_router__query_planner__tests__typename_propagation3.snap │ │ │ ├── apollo_router__query_planner__tests__typename_propagation.snap │ │ │ ├── apollo_router__query_planner__tests__typename_propagation2.snap │ │ │ ├── apollo_router__query_planner__tests__defer_if_condition-2.snap │ │ │ ├── apollo_router__query_planner__bridge_query_planner__tests__subselections-7.snap │ │ │ ├── apollo_router__query_planner__bridge_query_planner__tests__subselections-10.snap │ │ │ ├── apollo_router__query_planner__bridge_query_planner__tests__subselections-2.snap │ │ │ ├── apollo_router__query_planner__bridge_query_planner__tests__subselections-9.snap │ │ │ ├── apollo_router__query_planner__bridge_query_planner__tests__subselections-5.snap │ │ │ └── apollo_router__query_planner__bridge_query_planner__tests__subselections-14.snap │ ├── router │ │ └── event │ │ │ └── snapshots │ │ │ ├── apollo_router__router__event__schema__tests__schema_by_url@logs.snap │ │ │ ├── apollo_router__router__event__schema__tests__schema_no_watch@logs.snap │ │ │ ├── apollo_router__router__event__schema__tests__schema_success_fail_success@logs.snap │ │ │ └── apollo_router__router__event__schema__tests__schema_by_url_fallback@logs.snap │ ├── orbiter │ │ └── snapshots │ │ │ ├── apollo_router__orbiter__test__visit_args.snap │ │ │ ├── apollo_router__orbiter__test__visit_config_that_needed_upgrade.snap │ │ │ ├── apollo_router__orbiter__test__create_report_incorrect_type_validated_yaml.snap │ │ │ └── apollo_router__orbiter__test__create_report_invalid_validated_yaml.snap │ ├── main.rs │ ├── services │ │ ├── supergraph │ │ │ └── snapshots │ │ │ │ ├── apollo_router__services__supergraph__tests__root_selection_skipped.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__root_selection_not_included.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__subscription_with_callback.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__root_selection_set_statically_skipped.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__subscription_callback_schema_reload.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__subscription_with_callback_with_limit.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__filter_nullified_deferred_responses-3.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__root_selection_set_with_fragment_statically_skipped.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__root_selection_with_several_fields_statically_skipped.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__root_selection_set_with_inline_fragment_statically_skipped.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__nullability_formatting.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__no_typename_on_interface.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__root_selection_not_skipped.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__filter_nullified_deferred_responses.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__no_typename_on_interface-3.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__root_selection_skipped_with_other_fields.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__abstract_types_in_requires.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__errors_on_deferred_responses.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__no_typename_on_interface-2.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__aliased_typename_on_fragments.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__errors_from_primary_on_deferred_responses.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__fragment_reuse.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__interface_object_typename.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__invalid_input_enum-2.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__subscription_with_callback_with_limit-4.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__query_reconstruction.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__subscription_with_callback-3.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__subscription_with_callback_with_limit-3.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__reconstruct_deferred_query_under_interface.snap │ │ │ │ ├── apollo_router__services__supergraph__tests__subscription_callback_schema_reload-3.snap │ │ │ │ └── apollo_router__services__supergraph__tests__missing_entities.snap │ │ ├── new_service.rs │ │ ├── http │ │ │ ├── snapshots │ │ │ │ └── apollo_router__services__http__tests__unix_socket.snap │ │ │ └── testdata │ │ │ │ ├── client.ext │ │ │ │ └── server.ext │ │ ├── layers │ │ │ └── mod.rs │ │ └── query_batching │ │ │ └── testdata │ │ │ ├── batching_not_enabled_response.json │ │ │ └── badly_formatted_batch_response.json │ ├── spec │ │ └── query │ │ │ └── snapshots │ │ │ ├── apollo_router__spec__query__tests__filtered_defer_fragment-2.snap │ │ │ └── apollo_router__spec__query__tests__filtered_defer_fragment.snap │ └── snapshots │ │ ├── apollo_router__request__tests__null_extensions.snap │ │ ├── apollo_router__request__tests__missing_extensions.snap │ │ └── apollo_router__request__tests__extensions.snap ├── benches │ ├── huge_requests │ │ └── router.yaml │ └── deeply_nested │ │ └── router.yaml ├── tests │ ├── integration │ │ ├── telemetry │ │ │ ├── mod.rs │ │ │ └── fixtures │ │ │ │ ├── deprecated_spans.router.yaml │ │ │ │ ├── datadog.router.yaml │ │ │ │ └── zipkin.router.yaml │ │ ├── snapshots │ │ │ ├── integration_tests__integration__redis__test__apq.snap │ │ │ ├── integration_tests__integration__redis__test__entity_cache-3.snap │ │ │ ├── integration_tests__integration__redis__test__entity_cache-5.snap │ │ │ ├── integration_tests__integration__lifecycle__graceful_shutdown.snap │ │ │ └── integration_tests__integration__redis__test__entity_cache-2.snap │ │ └── mod.rs │ ├── fixtures │ │ ├── accounts.graphql │ │ ├── syntax_errors.rhai │ │ ├── batching │ │ │ ├── all_enabled.router.yaml │ │ │ ├── short_timeouts.router.yaml │ │ │ ├── block_request.rhai │ │ │ ├── rhai_script.router.yaml │ │ │ └── coprocessor.router.yaml │ │ ├── jwks-ec-no-alg.json │ │ ├── jwks-no-use.json │ │ ├── products.graphql │ │ ├── file_upload │ │ │ └── default.router.yaml │ │ ├── test_plugin_ordering.rhai │ │ ├── global_variables_test.rhai │ │ └── inventory.graphql │ └── snapshots │ │ ├── integration_tests__include_if_works.snap │ │ ├── integration_tests__defer_empty_primary_response.snap │ │ ├── integration_tests__defer_path.snap │ │ ├── integration_tests__defer_default_variable.snap │ │ ├── integration_tests__defer_default_variable-3.snap │ │ ├── integration_tests__defer_path-2.snap │ │ ├── integration_tests__defer_default_variable-2.snap │ │ ├── integration_tests__defer_empty_primary_response-2.snap │ │ ├── integration_tests__defer_query_without_accept.snap │ │ └── integration_tests__defer_path_with_disabled_config.snap └── feature_discussions.json ├── apollo-router-scaffold └── templates │ ├── plugin │ └── src │ │ └── plugins │ │ └── mod.rs │ └── base │ ├── .dockerignore │ ├── src │ ├── plugins │ │ └── mod.rs │ └── main.rs │ ├── .gitignore │ ├── .cargo │ └── config │ └── router.yaml ├── fuzz ├── .gitignore └── router.yaml ├── apollo-federation ├── tests │ ├── subgraph │ │ └── mod.rs │ ├── query_plan │ │ └── mod.rs │ ├── main.rs │ └── snapshots │ │ ├── main__composition_tests__compose_removes_federation_directives-2.snap │ │ ├── main__composition_tests__can_compose_types_from_different_subgraphs-2.snap │ │ └── main__composition_tests__can_compose_supergraph-2.snap ├── .github │ └── renovate.json5 ├── .cargo │ └── config.toml ├── cli │ └── Cargo.toml └── .gitignore ├── docs ├── README.md ├── source │ ├── images │ │ ├── sandbox.jpg │ │ ├── studio-trace.jpg │ │ ├── as-landing-page.jpg │ │ └── as-landing-page-production.jpg │ └── 404.md └── shared │ ├── elastic-notice.mdx │ ├── diagrams │ └── federation-architecture.mdx │ └── router-lifecycle-services.mdx ├── .github ├── CODEOWNERS └── workflows │ └── docs-publish.yml ├── rust-toolchain.toml ├── .cargo └── config.toml ├── .gitattributes ├── dockerfiles ├── tracing │ ├── datadog-subgraph │ │ ├── tracer.ts │ │ ├── Dockerfile │ │ └── tsconfig.json │ ├── supergraph.yml │ ├── jaeger-subgraph │ │ ├── Dockerfile │ │ └── tsconfig.json │ ├── zipkin-subgraph │ │ ├── Dockerfile │ │ ├── tsconfig.json │ │ └── recorder.ts │ └── router │ │ ├── Dockerfile │ │ ├── datadog.router.yaml │ │ ├── jaeger.router.yaml │ │ └── zipkin.router.yaml └── router.yaml ├── .git-blame-ignore-revs ├── xtask └── src │ └── commands │ └── changeset │ ├── scalars.rs │ └── snapshots │ ├── xtask__commands__changeset__tests__it_templatizes_with_neither_issues_or_prs.snap │ ├── xtask__commands__changeset__tests__it_templatizes_with_prs_in_title_when_empty_issues.snap │ ├── xtask__commands__changeset__tests__it_templatizes_without_prs_in_title_when_issues_present.snap │ ├── xtask__commands__changeset__tests__it_templatizes_with_multiple_prs_in_footer.snap │ └── xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title.snap ├── .githooks └── prepare-commit-msg ├── .gitmessage ├── docker-compose.yml ├── .changesets ├── fix_geal_input_enum_validation.md ├── maint_garypen_router_258_update_router_bridge.md ├── fix_bryn_json_schema.md └── fix_tninesling_undo_auth_changes.md ├── apollo-router-benchmarks └── src │ └── lib.rs ├── helm └── chart │ └── router │ └── .helmignore ├── netlify.toml └── .gitignore /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ignore: -------------------------------------------------------------------------------- 1 | router_errors.txt 2 | -------------------------------------------------------------------------------- /examples/unix-sockets/.unixonly: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/context/rust/.skipconfigvalidation: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apollo-router/examples/.skipconfigvalidation: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/async-auth/rust/.skipconfigvalidation: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/hello-world/rust/.skipconfigvalidation: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/custom-global-allocator/.gitignore: -------------------------------------------------------------------------------- 1 | Cargo.lock -------------------------------------------------------------------------------- /examples/supergraph-sdl/rust/.skipconfigvalidation: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apollo-router-scaffold/templates/plugin/src/plugins/mod.rs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/true.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/testdata/override-manual-demo.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/coprocessor-subgraph/rust/.skipconfigvalidation: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fuzz/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | target 3 | corpus 4 | artifacts 5 | -------------------------------------------------------------------------------- /apollo-router-scaffold/templates/base/.dockerignore: -------------------------------------------------------------------------------- 1 | target/** -------------------------------------------------------------------------------- /apollo-router-scaffold/templates/base/src/plugins/mod.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/.skipconfigvalidation: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/forbid-anonymous-operations/rust/.skipconfigvalidation: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/status-code-propagation/rust/.skipconfigvalidation: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apollo-federation/tests/subgraph/mod.rs: -------------------------------------------------------------------------------- 1 | mod parse_expand_tests; 2 | -------------------------------------------------------------------------------- /apollo-router-scaffold/templates/base/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /.idea/ 3 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/.skipconfigvalidation: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | See the *Documentation* section of ../CONTRIBUTING.md. 2 | -------------------------------------------------------------------------------- /examples/coprocessor-override-launchdarkly/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules -------------------------------------------------------------------------------- /examples/graphql/README.md: -------------------------------------------------------------------------------- 1 | # Common files used in the rest of the examples 2 | -------------------------------------------------------------------------------- /examples/coprocessor-subgraph/nodejs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /examples/unix-sockets/router_unix.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: /tmp/router.sock 3 | -------------------------------------------------------------------------------- /apollo-router/benches/huge_requests/router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 127.0.0.1:10142 3 | -------------------------------------------------------------------------------- /examples/logging/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: rhai_logging.rhai 4 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/subscription_enabled.yaml: -------------------------------------------------------------------------------- 1 | subscription: 2 | -------------------------------------------------------------------------------- /apollo-router/src/plugin/test/mock/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod canned; 2 | pub(super) mod subgraph; 3 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/record_replay/mod.rs: -------------------------------------------------------------------------------- 1 | mod record; 2 | mod recording; 3 | mod replay; 4 | -------------------------------------------------------------------------------- /apollo-router/src/protocols/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod multipart; 2 | pub(crate) mod websocket; 3 | -------------------------------------------------------------------------------- /examples/cache-control/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: cache_control.rhai 4 | -------------------------------------------------------------------------------- /examples/throw-error/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: rhai_throw_error.rhai 4 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/config_basic.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/invalid_url.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 127.0.0.1:0 3 | -------------------------------------------------------------------------------- /examples/op-name-to-header/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: op_name_to_header.rhai 4 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/defer.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | defer_support: true 3 | 4 | -------------------------------------------------------------------------------- /examples/add-timestamp-header/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: add_timestamp_header.rhai 4 | -------------------------------------------------------------------------------- /examples/cookies-to-headers/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: cookies_to_headers.rhai 4 | -------------------------------------------------------------------------------- /apollo-federation/tests/query_plan/mod.rs: -------------------------------------------------------------------------------- 1 | mod operation_optimization_tests; 2 | mod operation_validations_tests; 3 | -------------------------------------------------------------------------------- /examples/data-response-mutate/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: rhai_data_response_mutate.rhai 4 | -------------------------------------------------------------------------------- /examples/subgraph-request-log/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: rhai_subgraph_request_log.rhai 4 | -------------------------------------------------------------------------------- /examples/surrogate-cache-key/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: rhai_surrogate_cache_key.rhai 4 | -------------------------------------------------------------------------------- /apollo-federation/.github/renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json" 3 | } 4 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/authorization.router.yaml: -------------------------------------------------------------------------------- 1 | authorization: 2 | require_authentication: true -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/defer_support_ga.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | defer_support: true 3 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_scalar_list_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | intList 3 | } -------------------------------------------------------------------------------- /docs/source/images/sandbox.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netflix-Skunkworks/router/dev/docs/source/images/sandbox.jpg -------------------------------------------------------------------------------- /examples/error-response-mutate/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: rhai_error_response_mutate.rhai 4 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | /docs/ @apollographql/docs 2 | /apollo-federation/ @dariuszkuc @sachindshinde @goto-bus-stop @SimonSapin 3 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_mutation.graphql: -------------------------------------------------------------------------------- 1 | mutation { 2 | doSomething 3 | } -------------------------------------------------------------------------------- /apollo-router/tests/integration/telemetry/mod.rs: -------------------------------------------------------------------------------- 1 | mod jaeger; 2 | mod logging; 3 | mod metrics; 4 | mod otlp; 5 | mod zipkin; 6 | -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/testdata/log_on_broken_pipe.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | experimental_log_on_broken_pipe: true 3 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/batching.router.yaml: -------------------------------------------------------------------------------- 1 | batching: 2 | enabled: true 3 | mode: batch_http_link 4 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/health-check_to_health_check.router.yaml: -------------------------------------------------------------------------------- 1 | health-check: 2 | enabled: true 3 | -------------------------------------------------------------------------------- /docs/source/images/studio-trace.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netflix-Skunkworks/router/dev/docs/source/images/studio-trace.jpg -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/testdata/no_log_on_broken_pipe.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | experimental_log_on_broken_pipe: false 3 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/persisted-queries-preview.yaml: -------------------------------------------------------------------------------- 1 | preview_persisted_queries: 2 | enabled: true 3 | 4 | -------------------------------------------------------------------------------- /apollo-router/src/test_harness/mocks/mod.rs: -------------------------------------------------------------------------------- 1 | /// Mocks for the persisted queries uplink integration. 2 | pub mod persisted_queries; 3 | -------------------------------------------------------------------------------- /docs/source/images/as-landing-page.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netflix-Skunkworks/router/dev/docs/source/images/as-landing-page.jpg -------------------------------------------------------------------------------- /apollo-federation/tests/main.rs: -------------------------------------------------------------------------------- 1 | mod api_schema; 2 | mod composition_tests; 3 | mod extract_subgraphs; 4 | mod query_plan; 5 | mod subgraph; 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/authorization_directives.router.yaml: -------------------------------------------------------------------------------- 1 | authorization: 2 | directives: 3 | enabled: true -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/batching.yaml: -------------------------------------------------------------------------------- 1 | experimental_batching: 2 | enabled: true 3 | mode: batch_http_link 4 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/parser_recursion.router.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | experimental_parser_recursion_limit: 100 3 | -------------------------------------------------------------------------------- /apollo-router/src/testdata/supergraph_config.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 127.0.0.1:0 3 | health_check: 4 | listen: 127.0.0.1:0 5 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | # renovate-automation: rustc version 3 | channel = "1.76.0" 4 | components = [ "rustfmt", "clippy" ] 5 | -------------------------------------------------------------------------------- /apollo-router-scaffold/templates/base/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | xtask = "run --package xtask --" 3 | router = "run --package xtask -- router" 4 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/http_max_request_bytes.router.yaml: -------------------------------------------------------------------------------- 1 | limits: 2 | experimental_http_max_request_bytes: 4000000 -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/operation-limits-preview.yaml: -------------------------------------------------------------------------------- 1 | preview_operation_limits: 2 | parser_max_recursion: 1000 3 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | xtask = "run --locked --package xtask --manifest-path xtask/Cargo.toml --" 3 | fed = "run -p apollo-federation-cli --" 4 | -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/testdata/span_mode_deprecated.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | instrumentation: 3 | spans: 4 | mode: deprecated 5 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/zipkin_enabled.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | tracing: 3 | zipkin: 4 | endpoint: default 5 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_object_list_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | someObjects { 3 | field1 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_object_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | object1 { 3 | field1 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/datadog_enabled.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | tracing: 3 | datadog: 4 | endpoint: default 5 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_query.graphql: -------------------------------------------------------------------------------- 1 | query BasicQuery { 2 | getScalar(id: 2) 3 | anotherScalar 4 | } -------------------------------------------------------------------------------- /docs/source/images/as-landing-page-production.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netflix-Skunkworks/router/dev/docs/source/images/as-landing-page-production.jpg -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/testdata/span_mode_spec_compliant.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | instrumentation: 3 | spans: 4 | mode: spec_compliant 5 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/trace_config.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | tracing: 3 | trace_config: 4 | service_name: "foo" 5 | 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # https://github.com/github/linguist/blob/master/docs/overrides.md 2 | 3 | licenses.html linguist-vendored 4 | Cargo.lock linguist-generated=false 5 | -------------------------------------------------------------------------------- /apollo-router-scaffold/templates/base/src/main.rs: -------------------------------------------------------------------------------- 1 | mod plugins; 2 | 3 | use anyhow::Result; 4 | 5 | fn main() -> Result<()> { 6 | apollo_router::main() 7 | } 8 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_interface_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | interfaceInstance1 { 3 | field2 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_skipped_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | someObjects @skip(if: true) { 3 | field1 4 | } 5 | } -------------------------------------------------------------------------------- /apollo-router/src/query_planner/testdata/unknown_introspection_query.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | __schema { 3 | queryType { 4 | name 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/testdata/oss.router.yaml: -------------------------------------------------------------------------------- 1 | health_check: 2 | enabled: false 3 | homepage: 4 | enabled: false 5 | limits: 6 | parser_max_recursion: 1000 7 | -------------------------------------------------------------------------------- /examples/context/rust/router.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | # this plugin doesn't have any configuration 3 | # mention it here and you're set! 4 | example.context_data: 5 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/config_full.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | cors: 4 | origins: [foo, bar, baz] 5 | methods: [foo, bar] 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/query_planner_parallelism_auto.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | query_planning: 3 | experimental_parallelism: auto 4 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/query_planner_parallelism_static.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | query_planning: 3 | experimental_parallelism: 10 4 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/jaeger_enabled.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | tracing: 3 | jaeger: 4 | agent: 5 | endpoint: default 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/query_plan_cache.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | query_planning: 3 | experimental_cache: 4 | redis: 5 | urls: [] -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod cache_control; 2 | pub(crate) mod entity; 3 | pub(crate) mod metrics; 4 | #[cfg(test)] 5 | pub(crate) mod tests; 6 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/testdata/query.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | me { 3 | name { 4 | first 5 | last 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/testdata/span_mode_default.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | instrumentation: 3 | spans: 4 | default_attribute_requirement_level: required 5 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/jwt.router.yaml: -------------------------------------------------------------------------------- 1 | authentication: 2 | router: 3 | jwt: 4 | jwks: 5 | - url: https://example.com 6 | 7 | 8 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/telemetry_resources.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | metrics: 3 | common: 4 | resources: 5 | test: val 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/telemetry_tracing_propagation_awsxray.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | tracing: 3 | propagation: 4 | awsxray: true 5 | -------------------------------------------------------------------------------- /dockerfiles/tracing/datadog-subgraph/tracer.ts: -------------------------------------------------------------------------------- 1 | import tracer from 'dd-trace'; 2 | tracer.init(); // initialized in a different file to avoid hoisting. 3 | export default tracer; -------------------------------------------------------------------------------- /examples/coprocessor-override-launchdarkly/.env: -------------------------------------------------------------------------------- 1 | # Required 2 | LAUNCH_DARKLY_ENVIRONMENT= 3 | LAUNCH_DARKLY_PROJECT_ID= 4 | LAUNCH_DARKLY_REST_API_KEY= 5 | # Optional 6 | PORT= -------------------------------------------------------------------------------- /examples/supergraph-sdl/rust/router.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | # this plugin doesn't have any configuration 3 | # mention it here and you're set! 4 | example.supergraph_sdl: 5 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0006-apq.yaml: -------------------------------------------------------------------------------- 1 | description: supergraph.apq moved to apq 2 | actions: 3 | - type: move 4 | from: supergraph.apq 5 | to: apq 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/telemetry_attributes.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | tracing: 3 | common: 4 | attributes: 5 | test: val 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/telemetry_otlp_timeout.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | tracing: 3 | otlp: 4 | endpoint: default 5 | timeout: "5s" 6 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_required_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | ships { 3 | name 4 | registrationFee 5 | } 6 | } -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # .git-blame-ignore-revs 2 | 3 | # Reformat with imports_granularity = Item and group_imports = StdExternalCrate 4 | af3209126ffee9b825b694ee6913745873e8115b 5 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_delta.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | instrumentation: 3 | instruments: 4 | supergraph: 5 | cost.delta: true -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_actual.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | instrumentation: 3 | instruments: 4 | supergraph: 5 | cost.actual: true -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_excluded_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | anotherScalar 3 | someObjects @include(if: false) { 4 | field1 5 | } 6 | } -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_nested_list_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | someObjects { 3 | innerList { 4 | field2 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_named_query.graphql: -------------------------------------------------------------------------------- 1 | query NamedQuery { 2 | users { 3 | licenseNumber 4 | name 5 | } 6 | } -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_estimated.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | instrumentation: 3 | instruments: 4 | supergraph: 5 | cost.estimated: true -------------------------------------------------------------------------------- /dockerfiles/tracing/supergraph.yml: -------------------------------------------------------------------------------- 1 | subgraphs: 2 | accounts: 3 | routing_url: http://localhost:4001/ 4 | schema: 5 | subgraph_url: http://localhost:4001 6 | federation_version: 2 7 | -------------------------------------------------------------------------------- /docs/source/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "404" 3 | description: Page not found 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0023-batching.yaml: -------------------------------------------------------------------------------- 1 | description: Batching is no longer experimental 2 | actions: 3 | - type: move 4 | from: experimental_batching 5 | to: batching 6 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/accounts.graphql: -------------------------------------------------------------------------------- 1 | extend type Query { 2 | me: User 3 | } 4 | 5 | type User @key(fields: "id") { 6 | id: ID! 7 | name: String 8 | username: String 9 | } 10 | -------------------------------------------------------------------------------- /examples/forbid-anonymous-operations/rust/router.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | # this plugin doesn't have any configuration 3 | # mention it here and you're set! 4 | example.forbid_anonymous_operations: 5 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/otlp_enabled.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | tracing: 3 | otlp: 4 | endpoint: default 5 | metrics: 6 | otlp: 7 | endpoint: default 8 | -------------------------------------------------------------------------------- /dockerfiles/router.yaml: -------------------------------------------------------------------------------- 1 | # Configuration of the router's HTTP server 2 | # Default configuration for container 3 | supergraph: 4 | # The socket address and port to listen on 5 | listen: 0.0.0.0:4000 6 | -------------------------------------------------------------------------------- /examples/hello-world/rust/router.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | # this plugin has one piece of configuration, 3 | # the name of the entity you'd like to say hello to 4 | example.hello_world: 5 | name: "Bob" 6 | -------------------------------------------------------------------------------- /examples/telemetry/otlp.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | otlp: 7 | enabled: true 8 | endpoint: default 9 | -------------------------------------------------------------------------------- /apollo-router-scaffold/templates/base/router.yaml: -------------------------------------------------------------------------------- 1 | # uncomment this section if you plan to use the Dockerfile 2 | # supergraph: 3 | # listen: 0.0.0.0:4000 4 | plugins: 5 | # Add plugin configuration here 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/jaeger_scheduled_delay.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | tracing: 3 | jaeger: 4 | scheduled_delay: 100ms 5 | agent: 6 | endpoint: default 7 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/mod.rs: -------------------------------------------------------------------------------- 1 | mod directives; 2 | mod schema_aware_response; 3 | pub(crate) mod static_cost; 4 | 5 | use crate::plugins::demand_control::DemandControlError; 6 | -------------------------------------------------------------------------------- /apollo-router/src/router/event/snapshots/apollo_router__router__event__schema__tests__schema_by_url@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/router/event/schema.rs 3 | expression: yaml 4 | --- 5 | [] 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/router/event/snapshots/apollo_router__router__event__schema__tests__schema_no_watch@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/router/event/schema.rs 3 | expression: yaml 4 | --- 5 | [] 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__license_stream__test__validate_no_claim@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/license_stream.rs 3 | expression: yaml 4 | --- 5 | [] 6 | 7 | -------------------------------------------------------------------------------- /examples/async-auth/rust/allowedClientIds.json: -------------------------------------------------------------------------------- 1 | [ 2 | "avery", 3 | "benjamin", 4 | "bryn", 5 | "cecile", 6 | "gary", 7 | "geoffroy", 8 | "irina", 9 | "jeremy", 10 | "jesse" 11 | ] 12 | -------------------------------------------------------------------------------- /examples/telemetry/datadog.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | datadog: 7 | enabled: true 8 | endpoint: default 9 | -------------------------------------------------------------------------------- /xtask/src/commands/changeset/scalars.rs: -------------------------------------------------------------------------------- 1 | /// The GitHub API uses a Scalar called URI. I promise it's still 2 | /// just a String. 3 | #[allow(clippy::upper_case_acronyms)] 4 | pub(crate) type URI = String; 5 | -------------------------------------------------------------------------------- /apollo-federation/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | cli = "run -p apollo-federation-cli --" 3 | 4 | # circle seems to install cargo packages via ssh:// rather than https:// 5 | [net] 6 | git-fetch-with-cli = true 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0005-health_check_snake.yaml: -------------------------------------------------------------------------------- 1 | description: health-check renamed to health_check 2 | actions: 3 | - type: move 4 | from: health-check 5 | to: health_check 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/testdata/otlp.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | otlp: 7 | enabled: true 8 | endpoint: default 9 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__license_stream__test__validate_audience_single@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/license_stream.rs 3 | expression: yaml 4 | --- 5 | [] 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/syntax_errors.rhai: -------------------------------------------------------------------------------- 1 | fn supergraph_service(service) { 2 | let response = Fn("supergraph_response") // There should be a semicolon here 3 | service.map_response(response); 4 | } 5 | -------------------------------------------------------------------------------- /dockerfiles/tracing/datadog-subgraph/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20-bullseye 2 | 3 | WORKDIR /src 4 | 5 | ADD ./*.ts ./*.json /src/ 6 | 7 | RUN npm ci 8 | RUN npx tsc 9 | 10 | CMD [ "node", "dist/index.js" ] 11 | -------------------------------------------------------------------------------- /dockerfiles/tracing/jaeger-subgraph/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20-bullseye 2 | 3 | WORKDIR /src 4 | 5 | ADD ./*.ts ./*.json /src/ 6 | 7 | RUN npm ci 8 | RUN npx tsc 9 | 10 | CMD [ "node", "dist/index.js" ] 11 | -------------------------------------------------------------------------------- /dockerfiles/tracing/zipkin-subgraph/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20-bullseye 2 | 3 | WORKDIR /src 4 | 5 | ADD ./*.ts ./*.json /src/ 6 | 7 | RUN npm ci 8 | RUN npx tsc 9 | 10 | CMD [ "node", "dist/index.js" ] 11 | -------------------------------------------------------------------------------- /examples/logging/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates basic logging using Rhai. 4 | 5 | Usage: 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /examples/telemetry/zipkin-agent.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | zipkin: 7 | enabled: true 8 | endpoint: default 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/supergraph_config.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: "127.0.0.1:4001" 3 | cors: 4 | origins: 5 | - studio.apollographql.com 6 | methods: 7 | - GET 8 | - PUT 9 | -------------------------------------------------------------------------------- /apollo-router/src/testdata/datadog.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | datadog: 7 | enabled: true 8 | endpoint: default 9 | -------------------------------------------------------------------------------- /apollo-router/src/testdata/zipkin.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | zipkin: 7 | enabled: true 8 | endpoint: default 9 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__license_stream__test__validate_audience_multiple@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/license_stream.rs 3 | expression: yaml 4 | --- 5 | [] 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/tests/snapshots/integration_tests__include_if_works.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration_tests.rs 3 | expression: stream.next().await.unwrap().unwrap() 4 | --- 5 | { 6 | "data": {} 7 | } 8 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0009-subscription-enabled.yaml: -------------------------------------------------------------------------------- 1 | description: Add enabled field in subscription 2 | actions: 3 | - type: add 4 | path: subscription 5 | name: enabled 6 | value: true 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/demand_control.router.yaml: -------------------------------------------------------------------------------- 1 | experimental_demand_control: 2 | enabled: true 3 | mode: measure 4 | strategy: 5 | static_estimated: 6 | list_size: 30 7 | max: 256 -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_deferred_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | ships { 3 | name 4 | ... @defer { 5 | registrationFee 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /apollo-router/tests/integration/snapshots/integration_tests__integration__redis__test__apq.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/redis_test.rs 3 | expression: s.unwrap() 4 | --- 5 | "{ topProducts { name name2:name } }" 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0007-coprocessor_subgraph_url.yaml: -------------------------------------------------------------------------------- 1 | description: coprocessor.subgraph.all.response.uri was removed 2 | actions: 3 | - type: delete 4 | path: coprocessor.subgraph.all.response.uri 5 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0010-auth-jwt.yaml: -------------------------------------------------------------------------------- 1 | description: Move jwt configuration to authentication.router 2 | actions: 3 | - type: move 4 | from: authentication.jwt 5 | to: authentication.router.jwt 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0024-graphql_validation.yaml: -------------------------------------------------------------------------------- 1 | description: experimental_graphql_validation_mode is no longer supported 2 | actions: 3 | - type: delete 4 | path: experimental_graphql_validation_mode 5 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/zipkin.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | zipkin: 7 | enabled: true 8 | endpoint: default 9 | -------------------------------------------------------------------------------- /apollo-router/src/orbiter/snapshots/apollo_router__orbiter__test__visit_args.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/orbiter/mod.rs 3 | expression: usage 4 | --- 5 | args.config_path.: 1 6 | args.hot_reload.true: 1 7 | 8 | -------------------------------------------------------------------------------- /apollo-router/tests/integration/telemetry/fixtures/deprecated_spans.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | apollo: 3 | field_level_instrumentation_sampler: always_off 4 | instrumentation: 5 | spans: 6 | mode: deprecated 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/sigv4.router.yaml: -------------------------------------------------------------------------------- 1 | authentication: 2 | subgraph: 3 | all: 4 | aws_sig_v4: 5 | default_chain: 6 | service_name: "Foo" 7 | region: "us-east-1" 8 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__interface_typename-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: paths 4 | --- 5 | [] 6 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__interface_typename-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: paths 4 | --- 5 | [] 6 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_execution_request.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/demand_control/mod.rs 3 | expression: body 4 | --- 5 | - {} 6 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_execution_response.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/demand_control/mod.rs 3 | expression: body 4 | --- 5 | - {} 6 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_subgraph_request.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/demand_control/mod.rs 3 | expression: body 4 | --- 5 | data: ~ 6 | -------------------------------------------------------------------------------- /apollo-router/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | match apollo_router::main() { 3 | Ok(_) => {} 4 | Err(e) => { 5 | eprintln!("{e}"); 6 | std::process::exit(1) 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__measure_on_subgraph_response.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/demand_control/mod.rs 3 | expression: body 4 | --- 5 | data: ~ 6 | -------------------------------------------------------------------------------- /examples/cookies-to-headers/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates header manipulation via Rhai script. 4 | 5 | Usage: 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /.githooks/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | firstLine=$(head -n1 $1) 4 | 5 | if [ -z "$firstLine" ] ;then 6 | commitTemplate=$(cat `git rev-parse --git-dir`/../.gitmessage) 7 | echo -e "$commitTemplate\n $(cat $1)" > $1 8 | fi 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_datadog.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | exporters: 5 | tracing: 6 | datadog: 7 | enabled: true 8 | endpoint: default 9 | 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/zipkin-address.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | zipkin: 7 | enabled: true 8 | endpoint: zipkin:9411 9 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_selection_skipped.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": {} 7 | } 8 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/license.jwks.json: -------------------------------------------------------------------------------- 1 | { 2 | "keys": [ 3 | { 4 | "alg": "EdDSA", 5 | "kty": "OKP", 6 | "crv": "Ed25519", 7 | "x": "1ALg6LEIXYv5xye4zWNaw1fJmABZZwhF_oRAuNfI0_s" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /apollo-router/tests/integration/telemetry/fixtures/datadog.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | datadog: 7 | enabled: true 8 | endpoint: default 9 | -------------------------------------------------------------------------------- /examples/cache-control/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates header and context manipulation via Rhai script. 4 | 5 | Usage: 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /examples/forbid-anonymous-operations/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates header and context manipulation via Rhai script. 4 | 5 | Usage: 6 | ```bash 7 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 8 | ``` 9 | -------------------------------------------------------------------------------- /examples/telemetry/jaeger-agent.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | jaeger: 7 | enabled: true 8 | agent: 9 | endpoint: default 10 | -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/snapshots/apollo_router__axum_factory__axum_http_server_factory__tests__request_cancel_no_log@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/axum_factory/axum_http_server_factory.rs 3 | expression: yaml 4 | --- 5 | [] 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/persisted_queries.router.yaml: -------------------------------------------------------------------------------- 1 | apq: 2 | enabled: false 3 | persisted_queries: 4 | enabled: true 5 | log_unknown: true 6 | safelist: 7 | require_id: true 8 | enabled: true 9 | 10 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__interface_type-7.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | test 7 | } 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_selection_not_included.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": {} 7 | } 8 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__subscription_with_callback.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: res 4 | --- 5 | { 6 | "data": null 7 | } 8 | -------------------------------------------------------------------------------- /examples/telemetry/zipkin-collector.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | zipkin: 7 | enabled: true 8 | endpoint: "https://example.com" 9 | 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0019-authorization-ga.yaml: -------------------------------------------------------------------------------- 1 | description: Authorization is no longer preview, `preview_directives` is renamed `directives` 2 | actions: 3 | - type: move 4 | from: preview_directives 5 | to: directives 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__default_config_has_defaults.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: "Configuration::default().validated_yaml" 4 | --- 5 | plugins: ~ 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__insert.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response.response.headers().get(CACHE_CONTROL) 4 | --- 5 | Some( 6 | "public", 7 | ) 8 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/metrics/snapshots/apollo_router__plugins__telemetry__metrics__apollo__test__apollo_metrics_parse_failure.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/telemetry/metrics/apollo.rs 3 | expression: results 4 | --- 5 | [] 6 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/testdata/schema_enforcement_spec_version_in_range.graphql: -------------------------------------------------------------------------------- 1 | schema 2 | @link(url: "https://specs.apollo.dev/link/v1.0") 3 | @link(url: "https://specs.apollo.dev/authenticated/v0.1", for: SECURITY) { 4 | query: Query 5 | } 6 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/testdata/schema_enforcement_spec_version_out_of_range.graphql: -------------------------------------------------------------------------------- 1 | schema 2 | @link(url: "https://specs.apollo.dev/link/v1.0") 3 | @link(url: "https://specs.apollo.dev/authenticated/v0.2", for: SECURITY) { 4 | query: Query 5 | } 6 | -------------------------------------------------------------------------------- /apollo-router/tests/snapshots/integration_tests__defer_empty_primary_response.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration_tests.rs 3 | expression: stream.next().await.unwrap().unwrap() 4 | --- 5 | { 6 | "data": {}, 7 | "hasNext": true 8 | } 9 | -------------------------------------------------------------------------------- /examples/add-timestamp-header/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates header and context manipulation via Rhai script. 4 | 5 | Usage: 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /examples/subgraph-request-log/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates logging subgraph request details via Rhai script. 4 | 5 | Usage: 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /examples/unix-sockets/README.md: -------------------------------------------------------------------------------- 1 | # Unix sockets 2 | 3 | Demonstrates configuring of the router to listen to a unix socket. 4 | 5 | ## Usage 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router_unix.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/telemetry_router_to_supergraph.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | metrics: 3 | common: 4 | attributes: 5 | router: 6 | request: 7 | header: 8 | - named: "fd" 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/zipkin-url.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | zipkin: 7 | enabled: true 8 | endpoint: http://zipkin:9411/api/v2/spans 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/zipkin-url_env.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | zipkin: 7 | enabled: true 8 | endpoint: ${env.TEST_CONFIG_ENDPOINT} 9 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__insert-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response.response.headers().get(CACHE_CONTROL) 4 | --- 5 | Some( 6 | "public", 7 | ) 8 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "currentUser": null 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_delta_with_attributes.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | instrumentation: 3 | instruments: 4 | supergraph: 5 | cost.delta: 6 | attributes: 7 | cost.result: true -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/metrics/snapshots/apollo_router__plugins__telemetry__metrics__apollo__test__apollo_metrics_validation_failure.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/telemetry/metrics/apollo.rs 3 | expression: results 4 | --- 5 | [] 6 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__labeler__tests__large_float_written_as_int.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/labeler.rs 3 | expression: result 4 | --- 5 | { 6 | field(id: 1234567890123) 7 | } 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_selection_set_statically_skipped.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": {} 7 | } 8 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__subscription_callback_schema_reload.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: res 4 | --- 5 | { 6 | "data": null 7 | } 8 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__subscription_with_callback_with_limit.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: res 4 | --- 5 | { 6 | "data": null 7 | } 8 | -------------------------------------------------------------------------------- /examples/throw-error/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates extracting body details and header manipulation via Rhai script. 4 | 5 | Usage: 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /.gitmessage: -------------------------------------------------------------------------------- 1 | # Title: Summary, imperative, start upper case, don't end with a period 2 | # No more than 50 chars. #### 50 chars is here: # 3 | 4 | # Replace 'xxx' with the github issue ID. 5 | resolves #xxx 6 | 7 | # Body: Explain *what* and *why* (not *how*). 8 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0008-operation-limits-ga.yaml: -------------------------------------------------------------------------------- 1 | description: Operation limits are no longer preview, `preview_operation_limits` is renamed `limits` 2 | actions: 3 | - type: move 4 | from: preview_operation_limits 5 | to: limits 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_jaeger_agent.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | exporters: 5 | tracing: 6 | jaeger: 7 | enabled: true 8 | agent: 9 | endpoint: default 10 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/fixtures/enforce_on_subgraph_request.router.yaml: -------------------------------------------------------------------------------- 1 | experimental_demand_control: 2 | enabled: true 3 | mode: enforce 4 | strategy: 5 | test: 6 | stage: subgraph_request 7 | error: estimated_cost_too_expensive -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_actual_with_attributes.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | instrumentation: 3 | instruments: 4 | supergraph: 5 | cost.actual: 6 | attributes: 7 | cost.result: true 8 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/config_new/cost/fixtures/cost_estimated_with_attributes.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | instrumentation: 3 | instruments: 4 | supergraph: 5 | cost.estimated: 6 | attributes: 7 | cost.result: true -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/metrics/snapshots/apollo_router__plugins__telemetry__metrics__apollo__test__apollo_metrics_multiple_operations.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/telemetry/metrics/apollo.rs 3 | expression: results 4 | --- 5 | [] 6 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/testdata/prometheus.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | apollo: 3 | client_name_header: name_header 4 | client_version_header: version_header 5 | exporters: 6 | metrics: 7 | prometheus: 8 | enabled: true 9 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__filter_nullified_deferred_responses-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: last 4 | --- 5 | { 6 | "hasNext": false 7 | } 8 | -------------------------------------------------------------------------------- /examples/op-name-to-header/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates extracting body details and header manipulation via Rhai script. 4 | 5 | Usage: 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0022-query-planner-cache.yaml: -------------------------------------------------------------------------------- 1 | description: The query plan cache is no longer experimental 2 | actions: 3 | - type: move 4 | from: supergraph.query_planning.experimental_cache 5 | to: supergraph.query_planning.cache 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_datadog_env.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | exporters: 5 | tracing: 6 | datadog: 7 | enabled: true 8 | endpoint: ${env.TEST_CONFIG_ENDPOINT} 9 | 10 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__no_cache_control-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response.response.headers().get(CACHE_CONTROL) 4 | --- 5 | Some( 6 | "no-store", 7 | ) 8 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__no_cache_control-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "currentUser": null 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__no_cache_control.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response.response.headers().get(CACHE_CONTROL) 4 | --- 5 | Some( 6 | "no-store", 7 | ) 8 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/fixtures/enforce_on_execution_request.router.yaml: -------------------------------------------------------------------------------- 1 | experimental_demand_control: 2 | enabled: true 3 | mode: enforce 4 | strategy: 5 | test: 6 | stage: execution_request 7 | error: estimated_cost_too_expensive -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/fixtures/enforce_on_execution_response.router.yaml: -------------------------------------------------------------------------------- 1 | experimental_demand_control: 2 | enabled: true 3 | mode: enforce 4 | strategy: 5 | test: 6 | stage: execution_response 7 | error: estimated_cost_too_expensive -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/fixtures/enforce_on_subgraph_response.router.yaml: -------------------------------------------------------------------------------- 1 | experimental_demand_control: 2 | enabled: true 3 | mode: enforce 4 | strategy: 5 | test: 6 | stage: subgraph_response 7 | error: estimated_cost_too_expensive -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/fixtures/measure_on_subgraph_request.router.yaml: -------------------------------------------------------------------------------- 1 | experimental_demand_control: 2 | enabled: true 3 | mode: measure 4 | strategy: 5 | test: 6 | stage: execution_request 7 | error: estimated_cost_too_expensive 8 | -------------------------------------------------------------------------------- /examples/data-response-mutate/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates extracting body details and header manipulation via Rhai script. 4 | 5 | Usage: 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /examples/error-response-mutate/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates extracting body details and header manipulation via Rhai script. 4 | 5 | Usage: 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /examples/surrogate-cache-key/rhai/README.md: -------------------------------------------------------------------------------- 1 | # Rhai script 2 | 3 | Demonstrates extracting body details and header manipulation via Rhai script. 4 | 5 | Usage: 6 | 7 | ```bash 8 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 9 | ``` 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0004-defer_support_ga.yaml: -------------------------------------------------------------------------------- 1 | description: supergraph.preview_defer_support moved to supergraph.defer_support 2 | actions: 3 | - type: move 4 | from: supergraph.preview_defer_support 5 | to: supergraph.defer_support 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_otlp_grpc_basic.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | exporters: 5 | tracing: 6 | otlp: 7 | enabled: true 8 | endpoint: default 9 | protocol: http 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_otlp_http_basic.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | exporters: 5 | tracing: 6 | otlp: 7 | enabled: true 8 | endpoint: default 9 | protocol: http 10 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/fixtures/measure_on_execution_request.router.yaml: -------------------------------------------------------------------------------- 1 | experimental_demand_control: 2 | enabled: true 3 | mode: measure 4 | strategy: 5 | test: 6 | stage: execution_request 7 | error: estimated_cost_too_expensive 8 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/fixtures/measure_on_execution_response.router.yaml: -------------------------------------------------------------------------------- 1 | experimental_demand_control: 2 | enabled: true 3 | mode: measure 4 | strategy: 5 | test: 6 | stage: execution_response 7 | error: estimated_cost_too_expensive 8 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/fixtures/measure_on_subgraph_response.router.yaml: -------------------------------------------------------------------------------- 1 | experimental_demand_control: 2 | enabled: true 3 | mode: measure 4 | strategy: 5 | test: 6 | stage: execution_response 7 | error: estimated_cost_too_expensive 8 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_selection_set_with_fragment_statically_skipped.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": {} 7 | } 8 | -------------------------------------------------------------------------------- /examples/coprocessor-override-launchdarkly/router.example.yaml: -------------------------------------------------------------------------------- 1 | coprocessor: 2 | url: http://localhost:3000 # Required. Replace with the URL of your coprocessor's HTTP endpoint. 3 | supergraph: # Hook into the supergraph service 4 | request: 5 | context: true 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@subscription_enabled.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | subscription: 7 | enabled: true 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/supergraph_apq_to_apq.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | apq: 3 | router: 4 | cache: 5 | in_memory: 6 | limit: 2000 7 | redis: 8 | urls: 9 | - http://example.com 10 | -------------------------------------------------------------------------------- /apollo-router/src/services/new_service.rs: -------------------------------------------------------------------------------- 1 | //! Create a new tower Service instance. 2 | use tower::Service; 3 | 4 | /// Trait 5 | pub(crate) trait ServiceFactory { 6 | type Service: Service; 7 | 8 | fn create(&self) -> Self::Service; 9 | } 10 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_selection_with_several_fields_statically_skipped.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": {} 7 | } 8 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_jaeger_collector.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | exporters: 5 | tracing: 6 | jaeger: 7 | enabled: true 8 | collector: 9 | endpoint: http://example.com 10 | -------------------------------------------------------------------------------- /apollo-router/src/orbiter/snapshots/apollo_router__orbiter__test__visit_config_that_needed_upgrade.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/orbiter/mod.rs 3 | expression: usage 4 | --- 5 | configuration.supergraph.defer_support.len: 1 6 | configuration.supergraph.defer_support.true: 1 7 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__scalar-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | topProducts { 7 | type 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/basic_union_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | someUnion { 3 | ... on FirstObjectType { 4 | field1 5 | } 6 | ... on SecondObjectType { 7 | field2 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_selection_set_with_inline_fragment_statically_skipped.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": {} 7 | } 8 | -------------------------------------------------------------------------------- /apollo-router/src/spec/query/snapshots/apollo_router__spec__query__tests__filtered_defer_fragment-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/spec/query/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "a": { 8 | "b": "b" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /apollo-router/src/spec/query/snapshots/apollo_router__spec__query__tests__filtered_defer_fragment.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/spec/query/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "a": { 8 | "b": "b" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_invalid.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Err: fetch failed from all 3 uplink endpoints 6 | 7 | -------------------------------------------------------------------------------- /apollo-federation/cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "apollo-federation-cli" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | apollo-compiler.workspace = true 8 | apollo-federation = { path = ".." } 9 | clap = { version = "4.5.1", features = ["derive"] } 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0012-persisted-queries-ga.yaml: -------------------------------------------------------------------------------- 1 | description: Persisted queries are no longer preview, `preview_persisted_queries` is renamed `persisted_queries` 2 | actions: 3 | - type: move 4 | from: preview_persisted_queries 5 | to: persisted_queries 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0014-telemetry_trace_config_common.yaml: -------------------------------------------------------------------------------- 1 | description: telemetry.tracing.trace_config has been renamed to telemetry.tracing.common 2 | actions: 3 | - type: move 4 | from: telemetry.tracing.trace_config 5 | to: telemetry.tracing.common 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@batching.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | batching: 7 | enabled: true 8 | mode: batch_http_link 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@defer_support_ga.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | supergraph: 7 | defer_support: true 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@operation-limits-preview.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | limits: 7 | parser_max_recursion: 1000 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@parser_recursion.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | limits: 7 | parser_max_recursion: 100 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@persisted-queries-preview.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | persisted_queries: 7 | enabled: true 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__query_field-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | topProducts { 7 | type 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/src/services/http/snapshots/apollo_router__services__http__tests__unix_socket.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/http/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "id": "0" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@health-check_to_health_check.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | health_check: 7 | enabled: true 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/limits.router.yaml: -------------------------------------------------------------------------------- 1 | limits: 2 | max_depth: 1 3 | http_max_request_bytes: 2000000 4 | warn_only: true 5 | max_root_fields: 1 6 | parser_max_tokens: 15000 7 | parser_max_recursion: 500 8 | max_height: 2 9 | max_aliases: 2 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_apollo.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | apollo: 5 | endpoint: "http://example.com" 6 | client_version_header: apollographql-client-version 7 | client_name_header: apollographql-client-name 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_otlp_grpc_basic_env.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | exporters: 5 | tracing: 6 | otlp: 7 | enabled: true 8 | endpoint: ${env.TEST_CONFIG_ENDPOINT} 9 | protocol: http 10 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__query_field_alias-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | topProducts { 7 | type 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_failed_from_all.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Err: fetch failed from all 2 uplink endpoints 6 | 7 | -------------------------------------------------------------------------------- /dockerfiles/tracing/datadog-subgraph/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "esModuleInterop": true, 5 | "target": "es6", 6 | "moduleResolution": "node", 7 | "sourceMap": true, 8 | "outDir": "dist" 9 | }, 10 | "lib": ["es2015"] 11 | } 12 | -------------------------------------------------------------------------------- /dockerfiles/tracing/jaeger-subgraph/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "esModuleInterop": true, 5 | "target": "es6", 6 | "moduleResolution": "node", 7 | "sourceMap": true, 8 | "outDir": "dist" 9 | }, 10 | "lib": ["es2015"] 11 | } 12 | -------------------------------------------------------------------------------- /dockerfiles/tracing/zipkin-subgraph/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "esModuleInterop": true, 5 | "target": "es6", 6 | "moduleResolution": "node", 7 | "sourceMap": true, 8 | "outDir": "dist" 9 | }, 10 | "lib": ["es2015"] 11 | } 12 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@http_max_request_bytes.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | limits: 7 | http_max_request_bytes: 4000000 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__bridge_query_planner__tests__subselections.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/bridge_query_planner.rs 3 | expression: "subselections_keys(\"query Q { me { username name { first last }}}\").await" 4 | --- 5 | 6 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/batching/all_enabled.router.yaml: -------------------------------------------------------------------------------- 1 | # Simple config to enable batching for all subgraphs 2 | 3 | batching: 4 | enabled: true 5 | mode: batch_http_link 6 | subgraph: 7 | all: 8 | enabled: true 9 | 10 | include_subgraph_errors: 11 | all: true 12 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/apq.router.yaml: -------------------------------------------------------------------------------- 1 | apq: 2 | enabled: true 3 | router: 4 | cache: 5 | in_memory: 6 | limit: 10000 7 | redis: 8 | urls: 9 | - "http://example.com" 10 | subgraph: 11 | all: 12 | enabled: true 13 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_apollo_env.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | apollo: 5 | endpoint: "${env.TEST_CONFIG_ENDPOINT}" 6 | client_version_header: apollographql-client-version 7 | client_name_header: apollographql-client-name 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/tests/snapshots/integration_tests__defer_path.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration_tests.rs 3 | expression: stream.next().await.unwrap().unwrap() 4 | --- 5 | { 6 | "data": { 7 | "me": { 8 | "id": "1" 9 | } 10 | }, 11 | "hasNext": true 12 | } 13 | -------------------------------------------------------------------------------- /dockerfiles/tracing/zipkin-subgraph/recorder.ts: -------------------------------------------------------------------------------- 1 | const { BatchRecorder } = require("zipkin"); 2 | const { HttpLogger } = require("zipkin-transport-http"); 3 | 4 | module.exports.recorder = new BatchRecorder({ 5 | logger: new HttpLogger({ 6 | endpoint: "http://zipkin:9411/api/v2/spans" 7 | }) 8 | }); -------------------------------------------------------------------------------- /xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_neither_issues_or_prs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/commands/changeset/mod.rs 3 | expression: rendered_template 4 | --- 5 | ### TITLE 6 | 7 | BODY 8 | 9 | By [@AUTHOR](https://github.com/AUTHOR) 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0015-telemetry_metrics_resource.yaml: -------------------------------------------------------------------------------- 1 | description: telemetry.metrics.common.resources has been renamed to telemetry.metrics.common.resource 2 | actions: 3 | - type: move 4 | from: telemetry.metrics.common.resources 5 | to: telemetry.metrics.common.resource 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__expansion__test__prefixed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/expansion.rs 3 | expression: value 4 | --- 5 | defaulted: defaulted 6 | expanded: expanded 7 | no_env: defaulted 8 | overridden: overridden 9 | 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__expansion__test__unprefixed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/expansion.rs 3 | expression: value 4 | --- 5 | defaulted: defaulted 6 | expanded: expanded 7 | no_env: defaulted 8 | overridden: overridden 9 | 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/entities.router.yaml: -------------------------------------------------------------------------------- 1 | preview_entity_cache: 2 | redis: 3 | urls: [ "redis://localhost:6379" ] 4 | timeout: 5ms 5 | ttl: 60s 6 | enabled: true 7 | subgraphs: 8 | accounts: 9 | enabled: false 10 | products: 11 | ttl: 120s -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/file_uploads.router.yaml: -------------------------------------------------------------------------------- 1 | preview_file_uploads: 2 | enabled: true 3 | protocols: 4 | multipart: 5 | enabled: true 6 | mode: stream 7 | limits: 8 | max_file_size: 1mb 9 | max_files: 10 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_jaeger_collector_env.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | exporters: 5 | tracing: 6 | jaeger: 7 | enabled: true 8 | collector: 9 | endpoint: ${env.TEST_CONFIG_COLLECTOR_ENDPOINT} 10 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/logging/testdata/experimental_when_header.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | logging: 4 | experimental_when_header: 5 | - name: "custom-header1" 6 | match: "^val.*" 7 | headers: true 8 | body: true 9 | 10 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | services: 3 | redis: 4 | image: redis:latest 5 | ports: 6 | - 6379:6379 7 | jaeger: 8 | image: jaegertracing/all-in-one:latest 9 | ports: 10 | - 6831:6831/udp 11 | - 6832:6832/udp 12 | - 16686:16686 13 | - 14268:14268 -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0016-telemetry_tracing_resource.yaml: -------------------------------------------------------------------------------- 1 | description: telemetry.tracing.common.attributes has been renamed to telemetry.tracing.common.resource 2 | actions: 3 | - type: move 4 | from: telemetry.tracing.common.attributes 5 | to: telemetry.tracing.common.resource 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__expansion_failure_missing_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/mod.rs 3 | expression: error.to_string() 4 | --- 5 | could not expand variable: TEST_CONFIG_UNKNOWN_WITH_NO_DEFAULT, environment variable not found 6 | -------------------------------------------------------------------------------- /apollo-router/src/snapshots/apollo_router__request__tests__null_extensions.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/request.rs 3 | expression: expected_result 4 | --- 5 | query: "{ topProducts { upc name reviews { id product { name } author { id name } } } }" 6 | variables: 7 | date: "2022-01-01T00:00:00+00:00" 8 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/jwks-ec-no-alg.json: -------------------------------------------------------------------------------- 1 | { 2 | "keys": [ 3 | { 4 | "kty": "EC", 5 | "crv": "P-256", 6 | "x": "N9mNZYXyvhyzy5Xq3bD7aJp6R6I2SekVL2kE6byV5Z8", 7 | "y": "wQiY8AKPoWevbeedRa93WdOr9O71GpszF888u6lI9w8" 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /apollo-router/tests/snapshots/integration_tests__defer_default_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration_tests.rs 3 | expression: stream.next().await.unwrap().unwrap() 4 | --- 5 | { 6 | "data": { 7 | "me": { 8 | "id": "1" 9 | } 10 | }, 11 | "hasNext": true 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0017-propagation_aws_xray.yaml: -------------------------------------------------------------------------------- 1 | description: telemetry.tracing.propagation.awsxray has been renamed to telemetry.tracing.propagation.aws_xray 2 | actions: 3 | - type: move 4 | from: telemetry.tracing.propagation.awsxray 5 | to: telemetry.tracing.propagation.aws_xray 6 | -------------------------------------------------------------------------------- /apollo-router/src/services/layers/mod.rs: -------------------------------------------------------------------------------- 1 | //! Layers that are internal to the execution pipeline. 2 | pub(crate) mod allow_only_http_post_mutations; 3 | pub(crate) mod apq; 4 | pub(crate) mod content_negotiation; 5 | pub(crate) mod persisted_queries; 6 | pub(crate) mod query_analysis; 7 | pub(crate) mod static_page; 8 | -------------------------------------------------------------------------------- /apollo-router/src/snapshots/apollo_router__request__tests__missing_extensions.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/request.rs 3 | expression: expected_result 4 | --- 5 | query: "{ topProducts { upc name reviews { id product { name } author { id name } } } }" 6 | variables: 7 | date: "2022-01-01T00:00:00+00:00" 8 | -------------------------------------------------------------------------------- /apollo-router/benches/deeply_nested/router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 127.0.0.1:44167 3 | limits: 4 | parser_max_recursion: ${env.PARSER_MAX_RECURSION} 5 | include_subgraph_errors: 6 | all: true 7 | headers: 8 | all: 9 | request: 10 | - propagate: 11 | named: fibonacci-iterations 12 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__interface_type-9.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | test 7 | itf { 8 | ... on A { 9 | id 10 | } 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /docs/shared/elastic-notice.mdx: -------------------------------------------------------------------------------- 1 | 2 | 3 | The Apollo Router source code and all its distributions are made available under the [Elastic License v2.0 (ELv2) license](https://www.apollographql.com/docs/resources/elastic-license-v2-faq/#can-i-extend-or-modify-the-gateway-or-router-by-creating-plugins). 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/forbid-anonymous-operations/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | rhai: 2 | scripts: src 3 | main: forbid_anonymous_operations.rhai 4 | sandbox: 5 | enabled: true 6 | # make sure you enable introspection 7 | supergraph: 8 | introspection: true 9 | # make sure homepage is disabled 10 | homepage: 11 | enabled: false 12 | -------------------------------------------------------------------------------- /.changesets/fix_geal_input_enum_validation.md: -------------------------------------------------------------------------------- 1 | ### Validate enum values in input variables ([Issue #4633](https://github.com/apollographql/router/issues/4633)) 2 | 3 | The Router will now validate enum values provided in JSON variables. 4 | 5 | By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4753 -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0003-otlp_timout.yaml: -------------------------------------------------------------------------------- 1 | description: telemetry.tracing.otlp.timeout moved to telemetry.tracing.otlp.batch_processor.max_export_timeout 2 | actions: 3 | - type: move 4 | from: telemetry.tracing.otlp.timeout 5 | to: telemetry.tracing.otlp.batch_processor.max_export_timeout 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/tracing_jaeger_full.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | exporters: 5 | tracing: 6 | jaeger: 7 | enabled: true 8 | collector: 9 | endpoint: "http://foo" 10 | password: "" 11 | username: "" 12 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__extract_policies.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | "internal", 7 | "profile", 8 | "read user", 9 | "read username", 10 | } 11 | -------------------------------------------------------------------------------- /apollo-router/src/services/query_batching/testdata/batching_not_enabled_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors": [ 3 | { 4 | "message": "Invalid GraphQL request", 5 | "extensions": { 6 | "details": "batching not enabled", 7 | "code": "BATCHING_NOT_ENABLED" 8 | } 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /apollo-router/tests/snapshots/integration_tests__defer_default_variable-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration_tests.rs 3 | expression: stream.next().await.unwrap().unwrap() 4 | --- 5 | { 6 | "data": { 7 | "me": { 8 | "id": "1", 9 | "name": "Ada Lovelace" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/snapshots/apollo_router__axum_factory__axum_http_server_factory__tests__request_cancel_log@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/axum_factory/axum_http_server_factory.rs 3 | expression: yaml 4 | --- 5 | - fields: {} 6 | level: ERROR 7 | message: "broken pipe: the client closed the connection" 8 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__interface_inline_fragment-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | topProducts { 7 | type 8 | } 9 | itf { 10 | id 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__defer_if_condition.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/mod.rs 3 | expression: defer_primary_response 4 | --- 5 | { 6 | "data": { 7 | "me": { 8 | "__typename": "User", 9 | "id": "1" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_error_no_retry.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Err: "uplink error, the request will not be retried: code=NO_RETRY message=error message" 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@query_plan_cache.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | supergraph: 7 | query_planning: 8 | cache: 9 | redis: 10 | urls: [] 11 | 12 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__filter_basic_query-8.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | topProducts { 7 | type 8 | } 9 | me { 10 | id 11 | name 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__nullability_formatting.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "activeOrganization": null 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_failed_from_single.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Err: "fetch failed from uplink endpoint, and there are no fallback endpoints configured" 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__filter_basic_query-6.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | topProducts { 7 | type 8 | internal 9 | } 10 | me { 11 | id 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__scopes__tests__extract_scopes.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/scopes.rs 3 | expression: doc 4 | --- 5 | { 6 | "internal", 7 | "profile", 8 | "read:user", 9 | "read:username", 10 | "test", 11 | } 12 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/jwks-no-use.json: -------------------------------------------------------------------------------- 1 | { 2 | "keys": [ 3 | { 4 | "kty": "EC", 5 | "crv": "P-256", 6 | "x": "N9mNZYXyvhyzy5Xq3bD7aJp6R6I2SekVL2kE6byV5Z8", 7 | "y": "wQiY8AKPoWevbeedRa93WdOr9O71GpszF888u6lI9w8", 8 | "alg": "ES256" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /apollo-router/tests/integration/mod.rs: -------------------------------------------------------------------------------- 1 | mod batching; 2 | #[path = "../common.rs"] 3 | pub(crate) mod common; 4 | pub(crate) use common::IntegrationTest; 5 | 6 | mod docs; 7 | mod file_upload; 8 | mod lifecycle; 9 | mod operation_limits; 10 | mod redis; 11 | mod rhai; 12 | mod subscription; 13 | mod telemetry; 14 | mod validation; 15 | -------------------------------------------------------------------------------- /apollo-router/tests/integration/snapshots/integration_tests__integration__redis__test__entity_cache-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration/redis.rs 3 | expression: "v.as_object().unwrap().get(\"data\").unwrap()" 4 | --- 5 | { 6 | "reviews": [ 7 | { 8 | "body": "I can sit on it" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /apollo-router/tests/integration/snapshots/integration_tests__integration__redis__test__entity_cache-5.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration/redis.rs 3 | expression: "v.as_object().unwrap().get(\"data\").unwrap()" 4 | --- 5 | { 6 | "reviews": [ 7 | { 8 | "body": "I can eat in it" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /examples/telemetry/jaeger-collector.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | common: 5 | service_name: router 6 | jaeger: 7 | enabled: true 8 | collector: 9 | endpoint: "https://example.com" 10 | username: "username" 11 | password: "password" 12 | 13 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0001-telemetry_router_to_supergraph.yaml: -------------------------------------------------------------------------------- 1 | description: telemetry.tracing.trace_config.attributes.router has been renamed to 'supergraph' for consistency 2 | actions: 3 | - type: move 4 | from: telemetry.metrics.common.attributes.router 5 | to: telemetry.metrics.common.attributes.supergraph 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0021-http-max-request-bytes-ga.yaml: -------------------------------------------------------------------------------- 1 | description: HTTP request size limit is no longer experimental, `experimental_http_max_request_bytes` is renamed `http_max_request_bytes` 2 | actions: 3 | - type: move 4 | from: limits.experimental_http_max_request_bytes 5 | to: limits.http_max_request_bytes 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__custom_plugin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.custom_plugins 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: {} 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@trace_config.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | tracing: 9 | common: 10 | service_name: foo 11 | 12 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_deferred_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "ships": [ 4 | { 5 | "name": "Boaty McBoatface" 6 | }, 7 | { 8 | "name": "HMS Grapherson" 9 | } 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__no_typename_on_interface.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: no_typename 4 | --- 5 | { 6 | "data": { 7 | "dog": { 8 | "id": "4321", 9 | "name": "Spot" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_selection_not_skipped.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "id": "2", 9 | "name": "test" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/products.graphql: -------------------------------------------------------------------------------- 1 | extend type Mutation { 2 | createProduct(upc: ID!, name: String): Product 3 | } 4 | 5 | type Product @key(fields: "upc") { 6 | upc: String! 7 | name: String 8 | price: Int 9 | weight: Int 10 | } 11 | 12 | extend type Query { 13 | topProducts(first: Int = 5): [Product] 14 | } 15 | -------------------------------------------------------------------------------- /examples/forbid-mutations/README.md: -------------------------------------------------------------------------------- 1 | # Forbid Mutations 2 | 3 | Demonstrates forbidding mutations. 4 | 5 | This is particularly useful for when you are testing the router against an existing Gateway via traffic mirroring. 6 | 7 | ## Usage 8 | 9 | ```bash 10 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 11 | ``` 12 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__null_in_requires.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/tests.rs 3 | expression: "serde_json::to_value(&response).unwrap()" 4 | --- 5 | { 6 | "data": { 7 | "stuff": { 8 | "id": "1", 9 | "isEnabled": true 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__license_enforcement__test__schema_enforcement_spec_version_in_range.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/license_enforcement.rs 3 | assertion_line: 714 4 | expression: report.to_string() 5 | --- 6 | Schema features: 7 | * @authenticated 8 | https://specs.apollo.dev/authenticated/v0.1 9 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_fallback.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Ok: "result QueryResult { name: \"ok\", ordering: 1 }" 6 | - Ok: "result QueryResult { name: \"ok\", ordering: 2 }" 7 | 8 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/batching/short_timeouts.router.yaml: -------------------------------------------------------------------------------- 1 | # Batching config with short timeouts for testing 2 | 3 | batching: 4 | enabled: true 5 | mode: batch_http_link 6 | subgraph: 7 | all: 8 | enabled: true 9 | traffic_shaping: 10 | all: 11 | timeout: 1s 12 | 13 | include_subgraph_errors: 14 | all: true 15 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0002-jaeger_scheduled_delay.yaml: -------------------------------------------------------------------------------- 1 | description: telemetry.tracing.jaeger.scheduled_delay moved to telemetry.tracing.jaeger.batch_processor.scheduled_delay 2 | actions: 3 | - type: move 4 | from: telemetry.tracing.jaeger.scheduled_delay 5 | to: telemetry.tracing.jaeger.batch_processor.scheduled_delay 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@defer.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.defer 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: {} 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__defer_if_condition-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/mod.rs 3 | expression: defer_disabled 4 | --- 5 | { 6 | "data": { 7 | "me": { 8 | "id": "1", 9 | "name": "Ada Lovelace", 10 | "username": "@ada" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_round_robin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Ok: "result QueryResult { name: \"ok\", ordering: 1 }" 6 | - Ok: "result QueryResult { name: \"ok\", ordering: 2 }" 7 | 8 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_unchanged.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Ok: "result QueryResult { name: \"ok\", ordering: 1 }" 6 | - Ok: "result QueryResult { name: \"ok\", ordering: 2 }" 7 | 8 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__ignore_cloud_router_plugins.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.custom_plugins 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: {} 10 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__expansion_failure_unknown_mode.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/mod.rs 3 | expression: error.to_string() 4 | --- 5 | could not expand variable: unknown.TEST_CONFIG_UNKNOWN_WITH_NO_DEFAULT. Variables must be prefixed with one of 'env' followed by '.' e.g. 'env.' 6 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_without_span_list.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/telemetry/fmt_layer.rs 3 | expression: buff.to_string() 4 | --- 5 | [timestamp] ERROR Hello from nested test http.method="GET" 6 | [timestamp] INFO Hello from test event_attr="foo" 7 | 8 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__alias_renaming.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/tests.rs 3 | expression: "serde_json::to_value(&response).unwrap()" 4 | --- 5 | { 6 | "data": { 7 | "testQuery": { 8 | "foo": { 9 | "field": "aaa" 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__filter_nullified_deferred_responses.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: primary 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "name": "Ada" 9 | } 10 | }, 11 | "hasNext": true 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__no_typename_on_interface-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: with_reversed_fragments 4 | --- 5 | { 6 | "data": { 7 | "dog": { 8 | "name": "Spot", 9 | "id": "0000" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__root_selection_skipped_with_other_fields.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "otherUser": { 8 | "id": "2", 9 | "name": "test" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_error_retry.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Err: "uplink error: code=RETRY_LATER message=error message" 6 | - Ok: "result QueryResult { name: \"ok\", ordering: 1 }" 7 | 8 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_transforming_new_response_first_response_transform_fails.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Ok: "result TransformedQueryResult { name: \"ok\", halved_ordering: 50 }" 6 | 7 | -------------------------------------------------------------------------------- /examples/forbid-mutations/router.yaml: -------------------------------------------------------------------------------- 1 | # run a router with this configuration from the project's root directory: 2 | # ./router -c ./examples/forbid-mutations/router.yaml -s ./examples/graphql/supergraph.graphql 3 | # You can then open http://localhost:4000 on your browser, 4 | # and try to run a Query and a Mutation in apollo studio. 5 | forbid_mutations: true 6 | -------------------------------------------------------------------------------- /apollo-federation/tests/snapshots/main__composition_tests__compose_removes_federation_directives-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-federation/tests/composition_tests.rs 3 | expression: print_sdl(&supergraph.to_api_schema()) 4 | --- 5 | type Product { 6 | sku: String! 7 | name: String! 8 | } 9 | 10 | type Query { 11 | products: [Product!] 12 | } 13 | 14 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@jwt.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.authentication.jwt 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: {} 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/migrations/telemetry-exporters.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 1.2.3.4:5 3 | telemetry: 4 | tracing: 5 | common: 6 | service_name: "test_tracing" 7 | 8 | metrics: 9 | common: 10 | service_name: "test_metrics" 11 | 12 | logging: 13 | common: 14 | service_name: "test_logging" 15 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_attributes.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/telemetry/fmt_layer.rs 3 | expression: buff 4 | --- 5 | [timestamp] INFO test{another=2,custom_dyn=test,first=one,}  Hello from test event_attr="foo" 6 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__alias_renaming-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/tests.rs 3 | expression: "serde_json::to_value(&response).unwrap()" 4 | --- 5 | { 6 | "data": { 7 | "testQuery": { 8 | "foo": { 9 | "field": "bbb" 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__missing_fields_in_requires.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/tests.rs 3 | expression: "serde_json::to_value(&response).unwrap()" 4 | --- 5 | { 6 | "data": { 7 | "stuff": { 8 | "id": "1", 9 | "aDetailsIsEnabled": true 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/services/http/testdata/client.ext: -------------------------------------------------------------------------------- 1 | basicConstraints = CA:FALSE 2 | nsCertType = client, email 3 | nsComment = "OpenSSL Generated Client Certificate" 4 | subjectKeyIdentifier = hash 5 | authorityKeyIdentifier = keyid,issuer 6 | keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment 7 | extendedKeyUsage = clientAuth, emailProtection 8 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_empty_http_fallback.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Ok: "result QueryResult { name: \"ok\", ordering: 1 }" 6 | - Ok: "result QueryResult { name: \"ok\", ordering: 2 }" 7 | 8 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_empty_http_round_robin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Ok: "result QueryResult { name: \"ok\", ordering: 1 }" 6 | - Ok: "result QueryResult { name: \"ok\", ordering: 2 }" 7 | 8 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_error_http_fallback.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Ok: "result QueryResult { name: \"ok\", ordering: 1 }" 6 | - Ok: "result QueryResult { name: \"ok\", ordering: 2 }" 7 | 8 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__test__stream_from_uplink_error_http_round_robin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/mod.rs 3 | expression: "results.into_iter().map(to_friendly).collect::>()" 4 | --- 5 | - Ok: "result QueryResult { name: \"ok\", ordering: 1 }" 6 | - Ok: "result QueryResult { name: \"ok\", ordering: 2 }" 7 | 8 | -------------------------------------------------------------------------------- /examples/async-auth/rust/router.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | # this plugin takes a path 3 | # and will read from it everytime a request comes in 4 | # to check if a client can run a query 5 | example.allow_client_id_from_file: 6 | header: "x-client-id" # the header to check for 7 | path: "allowedClientIds.json" # the file that contains the allowed clients list 8 | -------------------------------------------------------------------------------- /examples/supergraph-sdl/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "supergraph_sdl" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = "1" 8 | apollo-compiler = "=1.0.0-beta.16" 9 | apollo-router = { path = "../../../apollo-router" } 10 | async-trait = "0.1" 11 | tower = { version = "0.4", features = ["full"] } 12 | tracing = "0.1" 13 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@telemetry_attributes.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | tracing: 9 | common: 10 | resource: 11 | test: val 12 | 13 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@telemetry_resources.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | metrics: 9 | common: 10 | resource: 11 | test: val 12 | 13 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__interface_typename.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | query Anonymous { 6 | post(id: "1") { 7 | ... on PublicBlog { 8 | __typename 9 | title 10 | } 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__abstract_types_in_requires.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: stream.next_response().await.unwrap() 4 | --- 5 | { 6 | "data": { 7 | "entity": { 8 | "fieldWithDependencies": "success" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/file_upload/default.router.yaml: -------------------------------------------------------------------------------- 1 | # Simple config for testing file uploads 2 | 3 | preview_file_uploads: 4 | enabled: true 5 | protocols: 6 | multipart: 7 | enabled: true 8 | mode: stream 9 | limits: 10 | max_file_size: 512kb 11 | max_files: 5 12 | include_subgraph_errors: 13 | all: true 14 | -------------------------------------------------------------------------------- /examples/coprocessor-subgraph/rust/README.md: -------------------------------------------------------------------------------- 1 | # External Subgraph Rust example 2 | 3 | This is an example that involves a router that exposes a custom endpoint as a coprocessor. 4 | 5 | ## Usage 6 | 7 | - Start the router 8 | 9 | ``` 10 | $ APOLLO_KEY="YOUR_APOLLO_KEY" APOLLO_GRAPH_REF="YOUR_APOLLO_GRAPH_REF" cargo run -- --configuration router.yaml 11 | ``` 12 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@sigv4.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.authentication.aws.sigv4 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: {} 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@datadog_enabled.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | tracing: 9 | datadog: 10 | endpoint: default 11 | enabled: true 12 | 13 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@telemetry_tracing_propagation_awsxray.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | tracing: 9 | propagation: 10 | aws_xray: true 11 | 12 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@zipkin_enabled.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | tracing: 9 | zipkin: 10 | endpoint: default 11 | enabled: true 12 | 13 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__interface_field-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | test 7 | itf { 8 | ... on A { 9 | other 10 | } 11 | ... on B { 12 | other 13 | } 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__missing_typename_and_fragments_in_requires.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/tests.rs 3 | expression: "serde_json::to_value(&response).unwrap()" 4 | --- 5 | { 6 | "data": { 7 | "stuff": { 8 | "id": "1", 9 | "isEnabled": true 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__missing_typename_and_fragments_in_requires2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/tests.rs 3 | expression: "serde_json::to_value(&response).unwrap()" 4 | --- 5 | { 6 | "data": { 7 | "stuff": { 8 | "id": "1", 9 | "isEnabled": true 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_on_deferred_responses.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: stream.next_response().await.unwrap() 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "id": "0" 9 | } 10 | }, 11 | "hasNext": true 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/test_plugin_ordering.rhai: -------------------------------------------------------------------------------- 1 | fn supergraph_service(service) { 2 | service.map_request(|request| { 3 | request.context["ordering-trace"].push("supergraph_service Rhai map_request") 4 | }); 5 | service.map_response(|response| { 6 | response.context["ordering-trace"].push("supergraph_service Rhai map_response") 7 | }); 8 | } -------------------------------------------------------------------------------- /examples/hello-world/rust/README.md: -------------------------------------------------------------------------------- 1 | # Hello world 2 | 3 | This plugin is the bare-bones example. 4 | 5 | You can copy it when creating your own plugins. 6 | 7 | Configuration that your plugin exposes will automatically participate in `router.yaml`. 8 | 9 | ## Usage 10 | 11 | ```bash 12 | cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml 13 | ``` 14 | -------------------------------------------------------------------------------- /fuzz/router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 0.0.0.0:4100 3 | introspection: true 4 | plugins: 5 | experimental.expose_query_plan: true 6 | apollo-test.expose_referenced_fields_by_type: true 7 | experimental_graphql_validation_mode: both 8 | sandbox: 9 | enabled: true 10 | homepage: 11 | enabled: false 12 | traffic_shaping: 13 | router: 14 | timeout: 300s -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/compression/codec/brotli/mod.rs: -------------------------------------------------------------------------------- 1 | // All code from this module is extracted from https://github.com/Nemo157/async-compression and is under MIT or Apache-2 licence 2 | // it will be removed when we find a long lasting solution to https://github.com/Nemo157/async-compression/issues/154 3 | mod encoder; 4 | 5 | pub(crate) use self::encoder::BrotliEncoder; 6 | -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/compression/codec/flate/mod.rs: -------------------------------------------------------------------------------- 1 | // All code from this module is extracted from https://github.com/Nemo157/async-compression and is under MIT or Apache-2 licence 2 | // it will be removed when we find a long lasting solution to https://github.com/Nemo157/async-compression/issues/154 3 | mod encoder; 4 | 5 | pub(crate) use self::encoder::FlateEncoder; 6 | -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/compression/codec/zstd/mod.rs: -------------------------------------------------------------------------------- 1 | // All code from this module is extracted from https://github.com/Nemo157/async-compression and is under MIT or Apache-2 licence 2 | // it will be removed when we find a long lasting solution to https://github.com/Nemo157/async-compression/issues/154 3 | mod encoder; 4 | 5 | pub(crate) use self::encoder::ZstdEncoder; 6 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__license_halt.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.lifecycle.license 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | license.state: halt 11 | 12 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__license_warn.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.lifecycle.license 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | license.state: warn 11 | 12 | -------------------------------------------------------------------------------- /apollo-router/src/orbiter/snapshots/apollo_router__orbiter__test__create_report_incorrect_type_validated_yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/orbiter/mod.rs 3 | expression: report 4 | --- 5 | session_id: "[session_id]" 6 | version: "[version]" 7 | platform: 8 | os: "[os]" 9 | continuous_integration: "[ci]" 10 | usage: 11 | configuration.plugins.len: 0 12 | 13 | -------------------------------------------------------------------------------- /apollo-router/src/services/http/testdata/server.ext: -------------------------------------------------------------------------------- 1 | subjectKeyIdentifier = hash 2 | authorityKeyIdentifier = keyid:always,issuer:always 3 | #basicConstraints = CA:TRUE 4 | keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign 5 | subjectAltName = DNS:localhost 6 | issuerAltName = issuer:copy 7 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__no_typename_on_interface-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: with_typename 4 | --- 5 | { 6 | "data": { 7 | "dog": { 8 | "id": "8765", 9 | "__typename": "Dog", 10 | "name": "Spot" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/compression/codec/deflate/mod.rs: -------------------------------------------------------------------------------- 1 | // All code from this module is extracted from https://github.com/Nemo157/async-compression and is under MIT or Apache-2 licence 2 | // it will be removed when we find a long lasting solution to https://github.com/Nemo157/async-compression/issues/154 3 | mod encoder; 4 | 5 | pub(crate) use self::encoder::DeflateEncoder; 6 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__aliased_typename_on_fragments.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: aliased_typename 4 | --- 5 | { 6 | "data": { 7 | "dog": { 8 | "name": "Spot", 9 | "nickname": "Spo", 10 | "barkVolume": 7 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.changesets/maint_garypen_router_258_update_router_bridge.md: -------------------------------------------------------------------------------- 1 | ### Update the version of the router-bridge ([PR #5064](https://github.com/apollographql/router/pull/5064)) 2 | 3 | Update our router-bridge version to pull in fixes. 4 | 5 | The router is now using: router-bridge = "=0.5.21+v2.7.5" 6 | 7 | By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/5064 -------------------------------------------------------------------------------- /apollo-router/src/configuration/testdata/metrics/subscriptions.router.yaml: -------------------------------------------------------------------------------- 1 | subscription: 2 | enabled: true 3 | mode: 4 | passthrough: 5 | all: 6 | protocol: graphql_ws 7 | callback: 8 | path: /graphql 9 | public_url: https://example.com/graphql 10 | enable_deduplication: false 11 | queue_capacity: 2 12 | max_opened_subscriptions: 3 13 | 14 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__interface_fragment-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | { 6 | topProducts { 7 | type 8 | } 9 | itf { 10 | id 11 | ...F 12 | } 13 | } 14 | 15 | fragment F on User { 16 | name 17 | } 18 | 19 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__license_stream__test__validate_audience_multiple_filtered@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/license_stream.rs 3 | expression: yaml 4 | --- 5 | - fields: 6 | code: APOLLO_ROUTER_LICENSE_OFFLINE_UNSUPPORTED 7 | level: ERROR 8 | message: "the license file was valid, but was not enabled offline use" 9 | 10 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__license_stream__test__validate_audience_single_filtered@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/license_stream.rs 3 | expression: yaml 4 | --- 5 | - fields: 6 | code: APOLLO_ROUTER_LICENSE_OFFLINE_UNSUPPORTED 7 | level: ERROR 8 | message: "the license file was valid, but was not enabled offline use" 9 | 10 | -------------------------------------------------------------------------------- /examples/coprocessor/README.md: -------------------------------------------------------------------------------- 1 | # External co-processing 2 | 3 | Demonstrates router request/response externalization can be performed via yaml configuration. 4 | 5 | Possible operations include externalizing: 6 | - Headers 7 | - Body 8 | - Context 9 | - SDL (schema) 10 | 11 | ## Usage 12 | 13 | ```bash 14 | cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml 15 | ``` 16 | -------------------------------------------------------------------------------- /apollo-router/src/axum_factory/compression/codec/gzip/mod.rs: -------------------------------------------------------------------------------- 1 | // All code from this module is extracted from https://github.com/Nemo157/async-compression and is under MIT or Apache-2 licence 2 | // it will be removed when we find a long lasting solution to https://github.com/Nemo157/async-compression/issues/154 3 | mod encoder; 4 | mod header; 5 | 6 | pub(crate) use self::encoder::GzipEncoder; 7 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0007-parser-recursion.yaml: -------------------------------------------------------------------------------- 1 | description: server.experimental_parser_recursion_limit moved to limits.parser_max_recursion, not experimental anymore. remove the server section, now empty 2 | actions: 3 | - type: move 4 | from: server.experimental_parser_recursion_limit 5 | to: limits.parser_max_recursion 6 | - type: delete 7 | path: server 8 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@batching.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.batching 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | opt.mode: batch_http_link 11 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@jaeger_enabled.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | tracing: 9 | jaeger: 10 | agent: 11 | endpoint: default 12 | enabled: true 13 | 14 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__policy__tests__interface_typename-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/policy.rs 3 | expression: doc 4 | --- 5 | query Anonymous { 6 | post(id: "1") { 7 | __typename 8 | ... on PublicBlog { 9 | __typename 10 | title 11 | } 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__errors_from_primary_on_deferred_responses.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: stream.next_response().await.unwrap() 4 | --- 5 | { 6 | "data": { 7 | "computer": { 8 | "id": "Computer1" 9 | } 10 | }, 11 | "hasNext": true 12 | } 13 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/batching/block_request.rhai: -------------------------------------------------------------------------------- 1 | // Simple rhai script to block a request for batching testing 2 | fn execution_service(service) { 3 | let request_callback = |request| { 4 | if request.body.query.contains("failMe") { 5 | throw "cancelled expected failure" 6 | } 7 | }; 8 | 9 | service.map_request(request_callback); 10 | } 11 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/batching/rhai_script.router.yaml: -------------------------------------------------------------------------------- 1 | # Simple config to enable batching and rhai scripts for testing 2 | 3 | batching: 4 | enabled: true 5 | mode: batch_http_link 6 | subgraph: 7 | all: 8 | enabled: true 9 | 10 | rhai: 11 | scripts: ./tests/fixtures/batching 12 | main: block_request.rhai 13 | 14 | include_subgraph_errors: 15 | all: true 16 | -------------------------------------------------------------------------------- /apollo-router/examples/router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 0.0.0.0:4100 3 | introspection: true 4 | query_planning: 5 | experimental_parallelism: auto # or any number 6 | plugins: 7 | experimental.expose_query_plan: true 8 | apollo-test.do_not_execute: true 9 | experimental_graphql_validation_mode: both 10 | sandbox: 11 | enabled: true 12 | homepage: 13 | enabled: false 14 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__tests__unauthenticated_request.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/mod.rs 3 | expression: response 4 | --- 5 | { 6 | "errors": [ 7 | { 8 | "message": "unauthenticated", 9 | "extensions": { 10 | "code": "AUTH_ERROR" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/global_variables_test.rhai: -------------------------------------------------------------------------------- 1 | // This test ensures that we can access router global variables 2 | // It doesn't test the values of the variables, apart from JWT CLAIMS 3 | fn process_router_global_variables() { 4 | 5 | return Router.APOLLO_SDL != () && Router.APOLLO_START != () && Router.APOLLO_AUTHENTICATION_JWT_CLAIMS == "apollo_authentication::JWT::claims"; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /examples/header-manipulation/README.md: -------------------------------------------------------------------------------- 1 | # Header manipulation 2 | 3 | Demonstrates header manipulation can be performed via yaml configuration. 4 | 5 | Possible operations are: 6 | 7 | - Insert 8 | - Propagate (exact, matching, rename, default) 9 | - Remove (exact, matching) 10 | 11 | ## Usage 12 | 13 | ```bash 14 | cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml 15 | ``` 16 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__authenticated__tests__mutation.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/authenticated.rs 3 | expression: "TestResult { query: QUERY, result: doc, paths }" 4 | --- 5 | query: 6 | 7 | mutation { 8 | other 9 | } 10 | 11 | filtered: 12 | 13 | paths: [""] 14 | -------------------------------------------------------------------------------- /apollo-router/src/services/query_batching/testdata/badly_formatted_batch_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors": [ 3 | { 4 | "message": "Invalid GraphQL request", 5 | "extensions": { 6 | "details": "failed to deserialize the request body into JSON: EOF while parsing a list at line 1 column 784", 7 | "code": "INVALID_GRAPHQL_REQUEST" 8 | } 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.github/workflows/docs-publish.yml: -------------------------------------------------------------------------------- 1 | name: Deploy docs to production 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - docs/** 9 | 10 | jobs: 11 | publish: 12 | uses: apollographql/docs/.github/workflows/publish.yml@main 13 | secrets: 14 | NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} 15 | NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} 16 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__authenticated__tests__unauthenticated_request_defer.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/authenticated.rs 3 | expression: first_response 4 | --- 5 | { 6 | "data": { 7 | "orga": { 8 | "id": 1, 9 | "creatorUser": { 10 | "id": 0 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_inline_fragment_query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | ships { 3 | owner { 4 | ... on User { 5 | licenseNumber 6 | name 7 | } 8 | } 9 | } 10 | users { 11 | ... on User { 12 | licenseNumber 13 | name 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /apollo-router/src/snapshots/apollo_router__request__tests__extensions.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/request.rs 3 | expression: expected_result 4 | --- 5 | query: "{ topProducts { upc name reviews { id product { name } author { id name } } } }" 6 | variables: 7 | date: "2022-01-01T00:00:00+00:00" 8 | extensions: 9 | something_simple: else 10 | something_complex: 11 | nested: value 12 | -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__license_enforcement__test__restricted_unix_socket_via_schema.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/license_enforcement.rs 3 | expression: report.to_string() 4 | --- 5 | Schema features: 6 | * @join__Graph.url 7 | https://specs.apollo.dev/join/v0.3 8 | 9 | Unix socket support for subgraph requests is restricted to Enterprise users 10 | -------------------------------------------------------------------------------- /dockerfiles/tracing/router/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 ubuntu:latest 2 | WORKDIR /usr/src/app 3 | RUN apt-get update && apt-get install -y \ 4 | libssl-dev \ 5 | curl \ 6 | jq 7 | 8 | #COPY install.sh . 9 | #RUN ./install.sh 10 | 11 | COPY ./router /usr/src/app 12 | 13 | STOPSIGNAL SIGINT 14 | 15 | 16 | # Default executable is the router 17 | ENTRYPOINT ["/usr/src/app/router"] -------------------------------------------------------------------------------- /dockerfiles/tracing/router/datadog.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 0.0.0.0:4000 3 | cors: 4 | origins: 5 | - https://studio.apollographql.com 6 | 7 | telemetry: 8 | exporters: 9 | tracing: 10 | common: 11 | service_name: router 12 | datadog: 13 | enabled: true 14 | endpoint: datadog-agent:8126 15 | propagation: 16 | datadog: true 17 | -------------------------------------------------------------------------------- /apollo-router/src/orbiter/snapshots/apollo_router__orbiter__test__create_report_invalid_validated_yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/orbiter/mod.rs 3 | expression: report 4 | --- 5 | session_id: "[session_id]" 6 | version: "[version]" 7 | platform: 8 | os: "[os]" 9 | continuous_integration: "[ci]" 10 | usage: 11 | configuration..: 1 12 | configuration.plugins.len: 0 13 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__typename_propagation3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/tests.rs 3 | expression: "serde_json::to_value(&response).unwrap()" 4 | --- 5 | { 6 | "data": { 7 | "book": { 8 | "__typename": "Book", 9 | "id": "1", 10 | "author": { 11 | "id": "2" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@query_planner_parallelism_auto.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.query_planning.parallelism 6 | data: 7 | datapoints: 8 | - value: 8 9 | attributes: 10 | mode: auto 11 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_named_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "users": [ 4 | { 5 | "licenseNumber": 1, 6 | "name": "Kate Chopin" 7 | }, 8 | { 9 | "licenseNumber": 2, 10 | "name": "Paul Auster" 11 | } 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /apollo-router/src/uplink/snapshots/apollo_router__uplink__license_enforcement__test__restricted_authorization_directives_via_schema.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/uplink/license_enforcement.rs 3 | expression: report.to_string() 4 | --- 5 | Schema features: 6 | * @authenticated 7 | https://specs.apollo.dev/authenticated/v0.1 8 | 9 | * @requiresScopes 10 | https://specs.apollo.dev/requiresScopes/v0.1 11 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/inventory.graphql: -------------------------------------------------------------------------------- 1 | directive @tag(name: String!) repeatable on 2 | | FIELD_DEFINITION 3 | | INTERFACE 4 | | OBJECT 5 | | UNION 6 | 7 | extend type Product @key(fields: "upc") { 8 | upc: String! @external 9 | weight: Int @external 10 | price: Int @external 11 | inStock: Boolean @tag(name: "private") 12 | shippingEstimate: Int @requires(fields: "price weight") 13 | } 14 | -------------------------------------------------------------------------------- /dockerfiles/tracing/router/jaeger.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 0.0.0.0:4000 3 | cors: 4 | origins: 5 | - https://studio.apollographql.com 6 | 7 | telemetry: 8 | exporters: 9 | tracing: 10 | common: 11 | service_name: router 12 | jaeger: 13 | enabled: true 14 | agent: 15 | endpoint: jaeger:6831 16 | propagation: 17 | jaeger: true 18 | -------------------------------------------------------------------------------- /dockerfiles/tracing/router/zipkin.router.yaml: -------------------------------------------------------------------------------- 1 | supergraph: 2 | listen: 0.0.0.0:4000 3 | cors: 4 | origins: 5 | - https://studio.apollographql.com 6 | 7 | telemetry: 8 | exporters: 9 | tracing: 10 | common: 11 | service_name: router 12 | zipkin: 13 | enabled: true 14 | endpoint: http://zipkin:9411/api/v2/spans 15 | propagation: 16 | zipkin: true 17 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@query_planner_parallelism_static.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.query_planning.parallelism 6 | data: 7 | datapoints: 8 | - value: 10 9 | attributes: 10 | mode: static 11 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__upgrade__test__upgrade_output.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/upgrade.rs 3 | expression: "generate_upgrade_output(\"changed: bar\\nstable: 1.0\\ndeleted: gone\",\n \"changed: bif\\nstable: 1.0\\nadded: new\",\n false).expect(\"expected successful migration\")" 4 | --- 5 | changed: bif 6 | stable: 1.0 7 | added: new 8 | 9 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_fragment_query.graphql: -------------------------------------------------------------------------------- 1 | fragment nameAndLicense on User { 2 | licenseNumber 3 | name 4 | } 5 | 6 | fragment identifiedOwner on Ship { 7 | owner { 8 | ...nameAndLicense 9 | } 10 | } 11 | 12 | { 13 | ships { 14 | ...identifiedOwner 15 | } 16 | users { 17 | ...nameAndLicense 18 | } 19 | } -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/testdata/prometheus_custom_buckets.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | apollo: 3 | client_name_header: name_header 4 | client_version_header: version_header 5 | exporters: 6 | metrics: 7 | common: 8 | service_name: apollo-router 9 | buckets: 10 | - 5 11 | - 10 12 | - 20 13 | prometheus: 14 | enabled: true 15 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__tests__authenticated_request.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/mod.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "orga": { 8 | "id": 1, 9 | "creatorUser": { 10 | "id": 0, 11 | "name": "Ada", 12 | "phone": "1234" 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__tests__scopes_directive-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "orga": { 8 | "id": 1, 9 | "creatorUser": { 10 | "id": 0, 11 | "name": "Ada", 12 | "phone": "1234" 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__typename_propagation.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/tests.rs 3 | expression: "serde_json::to_value(&response).unwrap()" 4 | --- 5 | { 6 | "data": { 7 | "node": { 8 | "__typename": "Book", 9 | "id": "1", 10 | "author": { 11 | "__typename": "Author" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__typename_propagation2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/tests.rs 3 | expression: "serde_json::to_value(&response).unwrap()" 4 | --- 5 | { 6 | "data": { 7 | "book": { 8 | "__typename": "Book", 9 | "id": "1", 10 | "author": { 11 | "__typename": "Author" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /apollo-router/tests/integration/telemetry/fixtures/zipkin.router.yaml: -------------------------------------------------------------------------------- 1 | telemetry: 2 | exporters: 3 | tracing: 4 | experimental_response_trace_id: 5 | enabled: true 6 | header_name: apollo-custom-trace-id 7 | common: 8 | service_name: router 9 | zipkin: 10 | enabled: true 11 | endpoint: default 12 | batch_processor: 13 | scheduled_delay: 10ms 14 | -------------------------------------------------------------------------------- /docs/shared/diagrams/federation-architecture.mdx: -------------------------------------------------------------------------------- 1 | ```mermaid 2 | graph BT; 3 | webapp(Web app); 4 | iosapp(iOS app); 5 | subgraph " "; 6 | gateway([Gateway]); 7 | serviceA[Users
subgraph]; 8 | serviceB[Products
subgraph]; 9 | serviceC[Reviews
subgraph]; 10 | end; 11 | webapp & iosapp -.- gateway; 12 | gateway --- serviceA & serviceB & serviceC; 13 | class webapp,iosapp secondary; 14 | ``` 15 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@supergraph_apq_to_apq.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | supergraph: {} 7 | apq: 8 | router: 9 | cache: 10 | in_memory: 11 | limit: 2000 12 | redis: 13 | urls: 14 | - "http://example.com" 15 | 16 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__tests__authenticated_directive-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "orga": { 8 | "id": 1, 9 | "creatorUser": { 10 | "id": 0, 11 | "name": "Ada", 12 | "phone": "1234" 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/cost_calculator/fixtures/federated_ships_required_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "ships": [ 4 | { 5 | "name": "Boaty McBoatface", 6 | "registrationFee": 200 7 | }, 8 | { 9 | "name": "HMS Grapherson", 10 | "registrationFee": 150 11 | } 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__tests__defer_if_condition-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/tests.rs 3 | expression: deferred_response 4 | --- 5 | { 6 | "data": { 7 | "me": { 8 | "name": "Ada Lovelace", 9 | "username": "@ada", 10 | "__typename": "User", 11 | "id": "1" 12 | } 13 | }, 14 | "path": [ 15 | "me" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__fragment_reuse.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "me": { 8 | "name": "Ada", 9 | "organizations": [ 10 | { 11 | "id": "2", 12 | "name": "Apollo" 13 | } 14 | ] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /apollo-router/tests/snapshots/integration_tests__defer_path-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration_tests.rs 3 | expression: stream.next().await.unwrap().unwrap() 4 | --- 5 | { 6 | "hasNext": false, 7 | "incremental": [ 8 | { 9 | "label": "name", 10 | "data": { 11 | "name": "Ada Lovelace" 12 | }, 13 | "path": [ 14 | "me" 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /examples/context/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "context-data" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | async-trait = "0.1" 11 | http = "0.2" 12 | tower = { version = "0.4", features = ["full"] } 13 | tracing = "0.1" 14 | -------------------------------------------------------------------------------- /xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_in_title_when_empty_issues.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/commands/changeset/mod.rs 3 | expression: rendered_template 4 | --- 5 | ### TITLE ([PR #PULL_NUMBER](https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER)) 6 | 7 | BODY 8 | 9 | By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER 10 | 11 | -------------------------------------------------------------------------------- /apollo-federation/tests/snapshots/main__composition_tests__can_compose_types_from_different_subgraphs-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-federation/tests/composition_tests.rs 3 | expression: print_sdl(&supergraph.to_api_schema()) 4 | --- 5 | type Product { 6 | sku: String! 7 | name: String! 8 | } 9 | 10 | type Query { 11 | products: [Product!] 12 | } 13 | 14 | type User { 15 | name: String 16 | email: String! 17 | } 18 | 19 | -------------------------------------------------------------------------------- /apollo-router-benchmarks/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | pub mod tests { 3 | include!("shared.rs"); 4 | 5 | #[test] 6 | fn test() { 7 | let runtime = tokio::runtime::Runtime::new().unwrap(); 8 | 9 | let builder = setup(); 10 | let router = runtime.block_on(builder.build_router()).unwrap(); 11 | runtime.block_on(async move { basic_composition_benchmark(router).await }); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__insert-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "activeOrganization": { 9 | "id": "1", 10 | "creatorUser": { 11 | "__typename": "User", 12 | "id": 2 13 | } 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__insert-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "activeOrganization": { 9 | "id": "1", 10 | "creatorUser": { 11 | "__typename": "User", 12 | "id": 2 13 | } 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "activeOrganization": { 9 | "id": "1", 10 | "creatorUser": { 11 | "__typename": "User", 12 | "id": 2 13 | } 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__private.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "activeOrganization": { 9 | "id": "1", 10 | "creatorUser": { 11 | "__typename": "User", 12 | "id": 2 13 | } 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_execution_request.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/demand_control/mod.rs 3 | expression: body 4 | --- 5 | - errors: 6 | - message: query estimated cost 2 exceeded configured maximum 1 7 | extensions: 8 | cost.estimated: 2 9 | cost.max: 1 10 | code: COST_ESTIMATED_TOO_EXPENSIVE 11 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_execution_response.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/demand_control/mod.rs 3 | expression: body 4 | --- 5 | - errors: 6 | - message: query estimated cost 2 exceeded configured maximum 1 7 | extensions: 8 | cost.estimated: 2 9 | cost.max: 1 10 | code: COST_ESTIMATED_TOO_EXPENSIVE 11 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_subgraph_request.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/demand_control/mod.rs 3 | expression: body 4 | --- 5 | data: ~ 6 | errors: 7 | - message: query estimated cost 2 exceeded configured maximum 1 8 | extensions: 9 | cost.estimated: 2 10 | cost.max: 1 11 | code: COST_ESTIMATED_TOO_EXPENSIVE 12 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/demand_control/snapshots/apollo_router__plugins__demand_control__test__enforce_on_subgraph_response.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/demand_control/mod.rs 3 | expression: body 4 | --- 5 | data: ~ 6 | errors: 7 | - message: query estimated cost 2 exceeded configured maximum 1 8 | extensions: 9 | cost.estimated: 2 10 | cost.max: 1 11 | code: COST_ESTIMATED_TOO_EXPENSIVE 12 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/traffic_shaping/rate/mod.rs: -------------------------------------------------------------------------------- 1 | //! Limit the rate at which requests are processed. 2 | 3 | mod error; 4 | pub(crate) mod future; 5 | mod layer; 6 | #[allow(clippy::module_inception)] 7 | mod rate; 8 | pub(crate) mod service; 9 | 10 | pub(crate) use self::error::RateLimited; 11 | pub(crate) use self::layer::RateLimitLayer; 12 | pub(crate) use self::rate::Rate; 13 | pub(crate) use self::service::RateLimit; 14 | -------------------------------------------------------------------------------- /examples/status-code-propagation/rust/router.yaml: -------------------------------------------------------------------------------- 1 | cors: 2 | origins: 3 | - "https://studio.apollographql.com/" 4 | plugins: 5 | example.propagate_status_code: 6 | # Status codes are represented in order, 7 | # if a subgraph returns a 400 8 | # and an other one returns a 401 9 | # the response status code will be 401 10 | status_codes: 11 | - 401 12 | - 403 13 | - 400 14 | - 500 15 | -------------------------------------------------------------------------------- /.changesets/fix_bryn_json_schema.md: -------------------------------------------------------------------------------- 1 | ### Make json schema small ([PR #5061](https://github.com/apollographql/router/pull/5061)) 2 | 3 | The json schema for the router.yaml is reduced in size from approx 100k lines to just over 7k. 4 | 5 | This reduces the startup time of the Router and a smaller schema is more friendly for code editors. 6 | 7 | By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographql/router/pull/5061 8 | -------------------------------------------------------------------------------- /.changesets/fix_tninesling_undo_auth_changes.md: -------------------------------------------------------------------------------- 1 | ### Use supergraph schema to extract auth info ([PR #5047](https://github.com/apollographql/router/pull/5047)) 2 | 3 | Use supergraph schema to extract auth info as auth information may not be available on the query planner's subgraph schemas. This undoes the auth changes made in #4975. 4 | 5 | By [@tninesling](https://github.com/tninesling) in https://github.com/apollographql/router/pull/5047 6 | -------------------------------------------------------------------------------- /apollo-federation/tests/snapshots/main__composition_tests__can_compose_supergraph-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-federation/tests/composition_tests.rs 3 | expression: print_sdl(&supergraph.to_api_schema()) 4 | --- 5 | enum E { 6 | V1 7 | V2 8 | } 9 | 10 | type Query { 11 | t: T 12 | } 13 | 14 | type S { 15 | x: Int 16 | } 17 | 18 | type T { 19 | k: ID 20 | a: Int 21 | b: String 22 | } 23 | 24 | union U = S | T 25 | 26 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@authorization.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.authorization 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | opt.directives: false 11 | opt.require_authentication: true 12 | -------------------------------------------------------------------------------- /apollo-router/tests/integration/snapshots/integration_tests__integration__lifecycle__graceful_shutdown.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration/lifecycle.rs 3 | expression: data 4 | --- 5 | { 6 | "data": { 7 | "topProducts": [ 8 | { 9 | "name": "Table" 10 | }, 11 | { 12 | "name": "Couch" 13 | }, 14 | { 15 | "name": "Chair" 16 | } 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /apollo-router/tests/snapshots/integration_tests__defer_default_variable-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration_tests.rs 3 | expression: stream.next().await.unwrap().unwrap() 4 | --- 5 | { 6 | "hasNext": false, 7 | "incremental": [ 8 | { 9 | "label": "name", 10 | "data": { 11 | "name": "Ada Lovelace" 12 | }, 13 | "path": [ 14 | "me" 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /examples/jwt-claims/rhai/router.yaml: -------------------------------------------------------------------------------- 1 | # You must enable router JWT authentication to extract claims 2 | # NOTE: a file URL cannot contain a relative path, so you must 3 | # specify an absolute path to make this example work. 4 | authentication: 5 | router: 6 | jwt: 7 | jwks: 8 | - url: file:///Users/garypen/dev/router/examples/jwt-claims/rhai/jwks.json 9 | 10 | rhai: 11 | scripts: src 12 | main: jwt_claims.rhai 13 | -------------------------------------------------------------------------------- /examples/status-code-propagation/rust/src/main.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | 3 | // adding the module to your main.rs file 4 | // will automatically register it to the router plugin registry. 5 | // 6 | // you can use the plugin by adding it to `router.yaml` 7 | mod propagate_status_code; 8 | 9 | // `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` 10 | fn main() -> Result<()> { 11 | apollo_router::main() 12 | } 13 | -------------------------------------------------------------------------------- /xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_without_prs_in_title_when_issues_present.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/commands/changeset/mod.rs 3 | expression: rendered_template 4 | --- 5 | ### TITLE ([Issue #ISSUE_NUMBER](https://github.com/REPO_WITH_OWNER/pull/ISSUE_NUMBER)) 6 | 7 | BODY 8 | 9 | By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__line_precise_config_errors_with_sequence.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: error.to_string() 4 | --- 5 | configuration had errors: 6 | 1. at line 9 7 | 8 | listen: 127.0.0.1:4000 9 | cors: 10 | allow_headers: 11 | - Content-Type 12 | - 5 13 | ^----- 5 is not of type "string" 14 | 15 | 16 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@telemetry_otlp_timeout.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | tracing: 9 | otlp: 10 | endpoint: default 11 | batch_processor: 12 | max_export_timeout: 5s 13 | enabled: true 14 | 15 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/cache/snapshots/apollo_router__plugins__cache__tests__no_cache_control-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/cache/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "activeOrganization": { 9 | "id": "1", 10 | "creatorUser": { 11 | "__typename": "User", 12 | "id": 2 13 | } 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /apollo-router/tests/snapshots/integration_tests__defer_empty_primary_response-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration_tests.rs 3 | expression: stream.next().await.unwrap().unwrap() 4 | --- 5 | { 6 | "hasNext": false, 7 | "incremental": [ 8 | { 9 | "label": "name", 10 | "data": { 11 | "name": "Ada Lovelace" 12 | }, 13 | "path": [ 14 | "me" 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /examples/coprocessor-subgraph/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "coprocessor", 3 | "version": "1.0.0", 4 | "description": "A coprocessor example for the router", 5 | "main": "src/index.js", 6 | "scripts": { 7 | "start": "node src/index.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "express": "^4.18.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@demand_control.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.experimental_demand_control 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | opt.mode: measure 11 | opt.strategy: static_estimated 12 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@file_uploads.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.file_uploads.multipart 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | opt.limits.max_file_size: 1mb 11 | opt.limits.max_files: 10 12 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__authenticated__tests__authenticated_request.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/authenticated.rs 3 | expression: response 4 | --- 5 | { 6 | "data": { 7 | "orga": { 8 | "id": 1, 9 | "creatorUser": { 10 | "id": 0, 11 | "name": "Ada", 12 | "phone": "1234" 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/coprocessor-subgraph/nodejs/README.md: -------------------------------------------------------------------------------- 1 | # External Subgraph nodejs example 2 | 3 | This is an example that involves a nodejs coprocessor alongside a router. 4 | 5 | ## Usage 6 | 7 | - Start the coprocessor: 8 | 9 | ```bash 10 | $ npm install && npm run start 11 | ``` 12 | 13 | - Start the router 14 | ``` 15 | $ APOLLO_KEY="YOUR_APOLLO_KEY" APOLLO_GRAPH_REF="YOUR_APOLLO_GRAPH_REF" cargo run -- --configuration router.yaml 16 | ``` 17 | -------------------------------------------------------------------------------- /examples/telemetry/README.md: -------------------------------------------------------------------------------- 1 | # Telemetry 2 | 3 | Demonstrates configuring of the router for: 4 | 5 | * OpenTelemetry 6 | * Jaeger 7 | * OpenTelemetry Collector 8 | 9 | 10 | ## OpenTelemetry 11 | 12 | ```bash 13 | cargo run -- -s ../../graphql/supergraph.graphql -c ./jaeger.router.yaml 14 | ``` 15 | 16 | ## OpenTelemetry Collector 17 | 18 | ```bash 19 | cargo run -- -s ../../graphql/supergraph.graphql -c ./oltp.router.yaml 20 | ``` 21 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@authorization_directives.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.authorization 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | opt.directives: true 11 | opt.require_authentication: false 12 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__interface_object_typename.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: stream.next_response().await.unwrap() 4 | --- 5 | { 6 | "data": { 7 | "searchContacts": [ 8 | { 9 | "inner": { 10 | "__typename": "Person", 11 | "country": "Fr" 12 | } 13 | } 14 | ] 15 | } 16 | } -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@otlp_enabled.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | tracing: 9 | otlp: 10 | endpoint: default 11 | enabled: true 12 | metrics: 13 | otlp: 14 | endpoint: default 15 | enabled: true 16 | 17 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__json_logging_attributes.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/telemetry/fmt_layer.rs 3 | expression: buff 4 | --- 5 | {"timestamp":"[timestamp]","level":"INFO","message":"Hello from test","event_attr":"foo","target":"apollo_router::plugins::telemetry::fmt_layer::tests","spans":[{"another":2,"custom_dyn":"test","first":"one","name":"test"}],"resource":{}} 6 | 7 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__invalid_input_enum-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "errors": [ 7 | { 8 | "message": "invalid type for variable: 'input'", 9 | "extensions": { 10 | "name": "input", 11 | "code": "VALIDATION_INVALID_TYPE_VARIABLE" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /examples/jwt-claims/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "jwt-claims" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /examples/logging/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rhai-logging" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1.17", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@apq.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.apq 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | opt.router.cache.in_memory: true 11 | opt.router.cache.redis: true 12 | opt.subgraph: true 13 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@entities.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.entity_cache 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | opt.enabled: true 11 | opt.subgraph.enabled: true 12 | opt.subgraph.ttl: true 13 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@telemetry_router_to_supergraph.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | metrics: 9 | common: 10 | attributes: 11 | supergraph: 12 | request: 13 | header: 14 | - named: fd 15 | 16 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__subscription_with_callback_with_limit-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: res 4 | --- 5 | { 6 | "data": null, 7 | "errors": [ 8 | { 9 | "message": "can't open new subscription, limit reached", 10 | "extensions": { 11 | "code": "SUBSCRIPTION_MAX_LIMIT" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /examples/cache-control/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cache-control" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__upgrade_old_configuration@jaeger_scheduled_delay.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: new_config 4 | --- 5 | --- 6 | telemetry: 7 | exporters: 8 | tracing: 9 | jaeger: 10 | agent: 11 | endpoint: default 12 | batch_processor: 13 | scheduled_delay: 100ms 14 | enabled: true 15 | 16 | -------------------------------------------------------------------------------- /apollo-router/src/router/event/snapshots/apollo_router__router__event__schema__tests__schema_success_fail_success@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/router/event/schema.rs 3 | expression: yaml 4 | --- 5 | - fields: 6 | http.response.status_code: 404 7 | url.full: "[url.full]" 8 | level: WARN 9 | message: failed to fetch supergraph schema 10 | - fields: {} 11 | level: ERROR 12 | message: failed to fetch supergraph schema from all urls 13 | 14 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__upgrade__test__diff_upgrade_output.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/upgrade.rs 3 | expression: "generate_upgrade_output(\"changed: bar\\nstable: 1.0\\ndeleted: gone\",\n \"changed: bif\\nstable: 1.0\\nadded: new\",\n true).expect(\"expected successful migration\")" 4 | --- 5 | -changed: bar 6 | +changed: bif 7 | stable: 1.0 8 | -deleted: gone 9 | +added: new 10 | 11 | -------------------------------------------------------------------------------- /examples/cookies-to-headers/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cookies-to-headers" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /examples/op-name-to-header/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "op-name-to-header" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__it_does_not_leak_env_variable_values.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: error.to_string() 4 | --- 5 | configuration had errors: 6 | 1. at line 3 7 | 8 | 9 | supergraph: 10 | introspection: ${env.TEST_CONFIG_NUMERIC_ENV_UNIQUE:-true} 11 | ^----- "${env.TEST_CONFIG_NUMERIC_ENV_UNIQUE:-true}" is not of type "boolean" 12 | 13 | 14 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__bridge_query_planner__tests__subselections-7.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/bridge_query_planner.rs 3 | expression: "subselections_keys(r#\"query Q { me {\n username\n ... on User @defer(label: \"A\") {\n name { first last }\n }\n }}\"#).await" 4 | --- 5 | None 0 query{ me { username } } 6 | Some("A") 0 query{ me { name { first last } } } 7 | -------------------------------------------------------------------------------- /examples/add-timestamp-header/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "add-timestamp-header" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /examples/surrogate-cache-key/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rhai-surrogate-cache-key" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/metrics/snapshots/apollo_router__plugins__telemetry__metrics__apollo__test__apollo_metrics_exclude.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/telemetry/metrics/apollo.rs 3 | expression: results 4 | --- 5 | [ 6 | { 7 | "request_id": "[REDACTED]", 8 | "stats": {}, 9 | "licensed_operation_count_by_type": { 10 | "type": "query", 11 | "subtype": null, 12 | "licensed_operation_count": 1 13 | } 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__bridge_query_planner__tests__subselections-10.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/bridge_query_planner.rs 3 | expression: "subselections_keys(r#\"\n query Q { me { username name { ... FirstLast @defer(label: \"A\") }}}\n fragment FirstLast on Name { first last }\n \"#).await" 4 | --- 5 | None 0 query{ me { username } } 6 | Some("A") 0 query{ me { name { first last } } } 7 | -------------------------------------------------------------------------------- /docs/shared/router-lifecycle-services.mdx: -------------------------------------------------------------------------------- 1 | The Apollo Router's request lifecycle has three major services: 2 | 3 | * **Router service** - Handles an incoming request before it is parsed. Works within a context of opaque bytes. 4 | * **Supergraph service** - Handles a request after it has been parsed and before it is sent to the subgraph. Works within a GraphQL context. 5 | * **Subgraph service** - Handles a request after it has been sent to the subgraph. Works within a GraphQL context. 6 | -------------------------------------------------------------------------------- /examples/data-response-mutate/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rhai-data-response-mutate" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /examples/error-response-mutate/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rhai-error-response-mutate" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /examples/subgraph-request-log/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rhai-subgraph-request-log" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /helm/chart/router/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_prs_in_footer.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/commands/changeset/mod.rs 3 | expression: rendered_template 4 | --- 5 | ### TITLE ([Issue #ISSUE_NUMBER](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER)) 6 | 7 | BODY 8 | 9 | By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER1, https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER2 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/feature_discussions.json: -------------------------------------------------------------------------------- 1 | { 2 | "experimental": { 3 | "experimental_retry": "https://github.com/apollographql/router/discussions/2241", 4 | "experimental_response_trace_id": "https://github.com/apollographql/router/discussions/2147", 5 | "experimental_when_header": "https://github.com/apollographql/router/discussions/1961" 6 | }, 7 | "preview": { 8 | "preview_entity_cache": "https://github.com/apollographql/router/discussions/4592" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/migrations/0018-telemetry-instruments-exporters.yaml: -------------------------------------------------------------------------------- 1 | description: telemetry.(tracing|metrics|logging) has been moved to to telemetry.exporters.(tracing|metrics|logging) 2 | actions: 3 | - type: move 4 | from: telemetry.tracing 5 | to: telemetry.exporters.tracing 6 | - type: move 7 | from: telemetry.logging 8 | to: telemetry.exporters.logging 9 | - type: move 10 | from: telemetry.metrics 11 | to: telemetry.exporters.metrics 12 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@persisted_queries.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.persisted_queries 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | opt.log_unknown: true 11 | opt.safelist.enabled: true 12 | opt.safelist.require_id: true 13 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__query_reconstruction.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph/tests.rs 3 | expression: stream.next_response().await.unwrap() 4 | --- 5 | { 6 | "errors": [ 7 | { 8 | "message": "invalid type for variable: 'userId'", 9 | "extensions": { 10 | "name": "userId", 11 | "code": "VALIDATION_INVALID_TYPE_VARIABLE" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__subscription_with_callback-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: stream.next_response().await.unwrap() 4 | --- 5 | { 6 | "data": { 7 | "userWasCreated": null 8 | }, 9 | "errors": [ 10 | { 11 | "message": "cannot fetch the name", 12 | "extensions": { 13 | "code": "INVALID" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /apollo-router/tests/snapshots/integration_tests__defer_query_without_accept.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration_tests.rs 3 | expression: "std::str::from_utf8(first.to_vec().as_slice()).unwrap()" 4 | --- 5 | {"errors":[{"message":"the router received a query with the @defer directive but the client does not accept multipart/mixed HTTP responses. To enable @defer support, add the HTTP header 'Accept: multipart/mixed;deferSpec=20220824'","extensions":{"code":"DEFER_BAD_HEADER"}}]} 6 | -------------------------------------------------------------------------------- /apollo-router/tests/integration/snapshots/integration_tests__integration__redis__test__entity_cache-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration/redis.rs 3 | expression: "v.as_object().unwrap().get(\"data\").unwrap()" 4 | --- 5 | { 6 | "topProducts": [ 7 | { 8 | "__typename": "Product", 9 | "upc": "1", 10 | "name": "chair" 11 | }, 12 | { 13 | "__typename": "Product", 14 | "upc": "2", 15 | "name": "table" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__authenticated__tests__interface_type.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/authenticated.rs 3 | expression: "TestResult { query: QUERY, result: doc, paths }" 4 | --- 5 | query: 6 | 7 | query { 8 | test 9 | itf { 10 | id 11 | } 12 | } 13 | 14 | filtered: 15 | { 16 | test 17 | } 18 | 19 | paths: ["/itf"] 20 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__bridge_query_planner__tests__subselections-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/bridge_query_planner.rs 3 | expression: "subselections_keys(r#\"query Q { me {\n username\n name {\n first\n ... @defer(label: \"A\") { last }\n }\n }}\"#).await" 4 | --- 5 | None 0 query{ me { username name { first } } } 6 | Some("A") 0 query{ me { name { last } } } 7 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__subscription_with_callback_with_limit-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: stream.next_response().await.unwrap() 4 | --- 5 | { 6 | "data": { 7 | "userWasCreated": null 8 | }, 9 | "errors": [ 10 | { 11 | "message": "cannot fetch the name", 12 | "extensions": { 13 | "code": "INVALID" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /examples/forbid-anonymous-operations/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "forbid_anonymous_operations_rhai" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__metrics__test__metrics@tls.router.yaml.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/metrics.rs 3 | expression: "&metrics.non_zero()" 4 | --- 5 | - name: apollo.router.config.tls 6 | data: 7 | datapoints: 8 | - value: 1 9 | attributes: 10 | opt.router.tls.server: true 11 | opt.router.tls.subgraph.ca_override: true 12 | opt.router.tls.subgraph.client_authentication: true 13 | -------------------------------------------------------------------------------- /apollo-router/src/plugin/test/mod.rs: -------------------------------------------------------------------------------- 1 | //! Utilities which make it easy to test with [`crate::plugin`]. 2 | 3 | mod mock; 4 | #[macro_use] 5 | mod service; 6 | mod broken; 7 | mod restricted; 8 | 9 | pub use mock::subgraph::MockSubgraph; 10 | pub use service::MockExecutionService; 11 | pub use service::MockHttpClientService; 12 | pub use service::MockRouterService; 13 | pub use service::MockSubgraphService; 14 | pub use service::MockSupergraphService; 15 | 16 | pub(crate) use self::mock::canned; 17 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__bridge_query_planner__tests__subselections-9.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/bridge_query_planner.rs 3 | expression: "subselections_keys(r#\"query Q { me {\n id\n reviews {\n id\n ... @defer(label: \"A\") { body(format: true) }\n }\n }}\"#).await" 4 | --- 5 | None 0 query{ me { id reviews { id } } } 6 | Some("A") 0 query{ me { reviews { body } } } 7 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__reconstruct_deferred_query_under_interface.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: stream.next_response().await.unwrap() 4 | --- 5 | { 6 | "data": { 7 | "me": { 8 | "id": 0, 9 | "fullName": "A", 10 | "memberships": [ 11 | { 12 | "permission": "USER" 13 | } 14 | ] 15 | } 16 | }, 17 | "hasNext": true 18 | } 19 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__subscription_callback_schema_reload-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: stream.next_response().await.unwrap() 4 | --- 5 | { 6 | "data": null, 7 | "errors": [ 8 | { 9 | "message": "subscription has been closed due to a schema reload", 10 | "extensions": { 11 | "code": "SUBSCRIPTION_SCHEMA_RELOAD" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | ignore = "exit 0" 3 | 4 | [build.environment] 5 | NODE_VERSION = "16" 6 | 7 | [context.deploy-preview.build] 8 | base = "docs" 9 | ignore = "git diff --quiet main HEAD ." 10 | command = """\ 11 | cd ../ 12 | rm -rf monodocs 13 | git clone https://github.com/apollographql/docs --branch main --single-branch monodocs 14 | cd monodocs 15 | npm i 16 | cp -r ../docs local 17 | DOCS_LOCAL=true npm run build \ 18 | """ 19 | publish = "../monodocs/public" 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | **/target/ 4 | .cargo_check 5 | 6 | # These are backup files generated by rustfmt 7 | **/*.rs.bk 8 | 9 | # IDE 10 | .idea 11 | *.iml 12 | .vscode 13 | 14 | # Docs 15 | /docs/node_modules/ 16 | /docs/.cache/ 17 | /docs/public 18 | 19 | # Prevent accidental commits of router.yaml in the root 20 | /router.yaml 21 | /jaeger/ 22 | 23 | # Previous git submodules 24 | dockerfiles/federation-demo 25 | dockerfiles/federation2-demo 26 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__bridge_query_planner__tests__subselections-5.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/bridge_query_planner.rs 3 | expression: "subselections_keys(r#\"query Q { user(id: 42) {\n username\n name {\n first\n ... @defer(label: \"A\") { last }\n }\n }}\"#).await" 4 | --- 5 | None 0 query{ user { username name { first } } } 6 | Some("A") 0 query{ user { name { last } } } 7 | -------------------------------------------------------------------------------- /apollo-router/src/services/supergraph/snapshots/apollo_router__services__supergraph__tests__missing_entities.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/services/supergraph_service.rs 3 | expression: stream.next_response().await.unwrap() 4 | --- 5 | { 6 | "data": { 7 | "currentUser": { 8 | "id": "0", 9 | "activeOrganization": { 10 | "id": "1", 11 | "name": null 12 | } 13 | } 14 | }, 15 | "errors": [ 16 | { 17 | "message": "error" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /examples/throw-error/rhai/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "throw-error" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [dependencies] 8 | anyhow = "1" 9 | apollo-router = { path = "../../../apollo-router" } 10 | http = "0.2" 11 | serde_json = "1" 12 | tokio = { version = "1", features = ["full"] } 13 | tower = { version = "0.4", features = ["full"] } 14 | 15 | [dev-dependencies] 16 | hyper = "0.14.24" 17 | -------------------------------------------------------------------------------- /xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/commands/changeset/mod.rs 3 | expression: rendered_template 4 | --- 5 | ### TITLE ([Issue #ISSUE_NUMBER1](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER1)), ([Issue #ISSUE_NUMBER2](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER2)) 6 | 7 | BODY 8 | 9 | By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER 10 | 11 | -------------------------------------------------------------------------------- /apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__line_precise_config_errors_bad_type.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/configuration/tests.rs 3 | expression: error.to_string() 4 | --- 5 | configuration had errors: 6 | 1. at line 5 7 | 8 | 9 | supergraph: 10 | # The socket address and port to listen on 11 | # Defaults to 127.0.0.1:4000 12 | listen: true 13 | ^----- true is not valid under any of the schemas listed in the 'anyOf' keyword 14 | 15 | 16 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__fmt_layer__tests__text_logging_with_custom_events.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/telemetry/fmt_layer.rs 3 | expression: buff.to_string() 4 | --- 5 | [timestamp] INFO test{another=2,custom_dyn=test,first=one,first=one,} http.response.body="{\"foo\": \"bar\"}" http.response.body.size="125" my message kind=my_custom_event 6 | [timestamp] ERROR test{another=2,custom_dyn=test,first=one,first=one,} Hello from test http.method="GET" 7 | -------------------------------------------------------------------------------- /apollo-router/src/router/event/snapshots/apollo_router__router__event__schema__tests__schema_by_url_fallback@logs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/router/event/schema.rs 3 | expression: yaml 4 | --- 5 | - fields: 6 | http.response.status_code: 400 7 | url.full: "[url.full]" 8 | level: WARN 9 | message: failed to fetch supergraph schema 10 | - fields: 11 | http.response.status_code: 400 12 | url.full: "[url.full]" 13 | level: WARN 14 | message: failed to fetch supergraph schema 15 | 16 | -------------------------------------------------------------------------------- /apollo-router/tests/fixtures/batching/coprocessor.router.yaml: -------------------------------------------------------------------------------- 1 | # Simple config to enable batching and a coprocessor for testing killed requests 2 | 3 | batching: 4 | enabled: true 5 | mode: batch_http_link 6 | subgraph: 7 | all: 8 | enabled: true 9 | 10 | coprocessor: 11 | url: http://127.0.0.1:REPLACEME # Will be overwritten by the test 12 | subgraph: 13 | all: 14 | request: 15 | service_name: true 16 | body: true 17 | 18 | include_subgraph_errors: 19 | all: true 20 | -------------------------------------------------------------------------------- /apollo-router/src/query_planner/snapshots/apollo_router__query_planner__bridge_query_planner__tests__subselections-14.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/query_planner/bridge_query_planner.rs 3 | expression: "subselections_keys(r#\"query Q($d1:Boolean!) { me {\n username\n name {\n first\n ... @defer(if: $d1, label: \"A\") { last }\n }\n }}\"#).await" 4 | --- 5 | None 1 query{ me { username name { first } } } 6 | Some("A") 1 query{ me { name { last } } } 7 | -------------------------------------------------------------------------------- /apollo-federation/.gitignore: -------------------------------------------------------------------------------- 1 | # idea 2 | .idea 3 | 4 | # Generated by Cargo 5 | # will have compiled files and executables 6 | debug/ 7 | target/ 8 | 9 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 10 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 11 | Cargo.lock 12 | 13 | # These are backup files generated by rustfmt 14 | **/*.rs.bk 15 | 16 | # MSVC Windows builds of rustc generate these, which store debugging information 17 | *.pdb 18 | -------------------------------------------------------------------------------- /apollo-router/tests/snapshots/integration_tests__defer_path_with_disabled_config.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/tests/integration_tests.rs 3 | expression: stream.next().await.unwrap().unwrap() 4 | --- 5 | { 6 | "errors": [ 7 | { 8 | "message": "Unknown directive \"@defer\".", 9 | "locations": [ 10 | { 11 | "line": 4, 12 | "column": 20 13 | } 14 | ], 15 | "extensions": { 16 | "code": "GRAPHQL_VALIDATION_FAILED" 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /apollo-router/src/plugins/authorization/snapshots/apollo_router__plugins__authorization__tests__scopes_directive_reject_unauthorized.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: apollo-router/src/plugins/authorization/tests.rs 3 | expression: response 4 | --- 5 | { 6 | "data": {}, 7 | "errors": [ 8 | { 9 | "message": "Unauthorized field or type", 10 | "path": [ 11 | "orga", 12 | "creatorUser" 13 | ], 14 | "extensions": { 15 | "code": "UNAUTHORIZED_FIELD_OR_TYPE" 16 | } 17 | } 18 | ] 19 | } 20 | --------------------------------------------------------------------------------