Skip to main content

node_count

Function node_count 

Source
pub fn node_count(
    document: &str,
    variables: &Variables,
) -> Result<u64, NodeCountError>
Expand description

The worst-case number of nodes the one operation in document may return, under variables, computed by GitHub’s published rules.

The document must hold exactly one operation. Fragment definitions beside it are resolved, so the natural consumer shape — one shared fragment concatenated onto each of several operations, giving several single-operation documents — is counted correctly, once per document.

§Errors

Returns NodeCountError rather than panicking, returning zero, or returning a wrong count, when: