document static method
Creates a complete DocumentNode with simplified syntax.
This is the main helper that combines all other helpers to create a complete DocumentNode with significantly reduced verbosity.
Example:
document([
operation(OperationType.query, 'simple_query', selections: [
field('pokemon', args: {'name': 'Charmander'}, selections: [
field('number'),
field('types'),
]),
]),
])
Implementation
static DocumentNode document(List<DefinitionNode> definitions) {
return DocumentNode(definitions: definitions);
}