Skip to main content

interpret_query_answer

Function interpret_query_answer 

Source
pub fn interpret_query_answer(value: Option<Value>) -> Value
Expand description

Interpret what a request-serving guest returned as the field’s data (#1329).

The convention is deliberately thin — the return value is the data — and extracted anyway, because the one case that needs a decision is the one a second implementation would get wrong: a guest that returns nothing. None is null, which a nullable field renders as null and a non-null field is refused for by the engine, naming the field. The alternative (treating “returned nothing” as an empty object) would render every selected field as null and say nothing.