hive-router-plan-executor

Crates.iohive-router-plan-executor
lib.rshive-router-plan-executor
version1.0.4
created_at2025-09-01 11:17:27.756678+00
updated_at2025-09-09 13:44:43.82996+00
descriptionGraphQL query planner executor for Federation specification
homepagehttps://github.com/graphql-hive/router
repositoryhttps://github.com/graphql-hive/router
max_upload_size
id1819441
size406,625
Dotan Simha (dotansimha)

documentation

README

Hive-Router's Plan Executor (hive-router-plan-executor)

This crate is a standalone library for performing GraphQL execution for a Federation query plan.

Installation

Add this to your Cargo.toml:

[dependencies]
hive-router-plan-executor = "<...>"

Usage

Start by either producing a plan (using Hive Router query-planner), or by loading it from a file or any other source.

For usage example, please follow the router binary hotpath. The step involved parsing, processing, planning and preparing the incoming operation.

Once all information is collected, you can use it as follows:

use hive_router_plan_executor::execute_query_plan;
use hive_router_plan_executor::execution::plan::QueryPlanExecutionContext;

// Result is a Vec<u8> you can send as final response or make into a Bytes buffer.
let result = execute_query_plan(QueryPlanExecutionContext {
    query_plan: query_plan_payload,
    projection_plan: &normalized_payload.projection_plan,
    variable_values: &variable_payload.variables_map,
    extensions,
    introspection_context: &introspection_context,
    operation_type_name: normalized_payload.root_type_name,
    executors: &subgraph_executor_map,
})
.await;
Commit count: 250

cargo fmt