Function partial_execute

Source
pub fn partial_execute(
    schema: &Valid<Schema>,
    implementers_map: &HashMap<Name, Implementers>,
    document: &Valid<ExecutableDocument>,
    operation: &Operation,
    variable_values: &Valid<JsonMap>,
) -> Result<ExecutionResponse, RequestError>
Expand description

Excecutes the schema introspection portion of a query and returns a partial response.

Concrete root fields (those with an explicit definition in the schema) are silently ignored.

Only introspection meta-fields are executed: __typename (at the response root), __type, and __schema. If the operation also contains concrete fields, the caller can execute them separately and merge the two partial responses. To categorize which kinds of root fields are present, consider using code like:

let mut has_schema_introspection_fields = false;
let mut has_root_typename_fields = false;
let mut has_concrete_fields = false;
for root_field in operation.root_fields(document) {
    match root_field.name.as_str() {
        "__type" | "__schema" => has_schema_introspection_fields = true,
        "__typename" => has_root_typename_fields = true,
        _ => has_concrete_fields = true,
    }
}