parse function

DocumentNode parse(
  1. SourceFile source
)

Parses source and returns DocumentNode.

Supports both GraphQL SDL and executable definitions.

Implementation

DocumentNode parse(
  SourceFile source,
) {
  final lexer = Lexer();
  final tokens = lexer.tokenize(source);
  final parser = _Parser(tokens);

  return parser.parse();
}