Skip to main content

worst_case_node_count

Function worst_case_node_count 

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

The most nodes document could be asked to return, by GitHub’s published rules.

Computed offline from the document’s own text under largest_page_sizes — no network, no credential and no schema — by github_graphql_node_count::node_count, which is where the rules themselves live. A document at or above NODE_COUNT_LIMIT is one GitHub refuses before executing, so this is what a check holds every document in graphql::DOCUMENTS below.

§Errors

Returns the calculation’s own NodeCountError when document does not parse, holds no single operation, or binds a page size this source does not name — each of which is a defect in the document rather than a number.