Skip to main content

extract_graphql_document

Function extract_graphql_document 

Source
pub fn extract_graphql_document(
    source_path: &str,
    input: &str,
) -> Result<GraphqlDocument, GraphqlExtractionError>
Expand description

Parses a standalone SDL or executable GraphQL document.

The function accepts one GraphQL grammar per artifact. A file mixing SDL and executable definitions is rejected because graphql-parser exposes those grammars separately.

ยงErrors

Returns GraphqlExtractionError::InvalidGraphql when neither dedicated parser accepts the complete input.