DocumentNodeHelpers class
Helper class for generating optimized DocumentNode AST structures.
This class provides template-based generation methods that reduce DocumentNode verbosity by 40-50% through intelligent caching and simplified helper functions.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
argument(
String name, dynamic value) → ArgumentNode - Creates an ArgumentNode with automatic value conversion.
-
clearCache(
) → void - Clears the entire NameNode cache.
-
document(
List< DefinitionNode> definitions) → DocumentNode - Creates a complete DocumentNode with simplified syntax.
-
field(
String name, {String? alias, Map< String, dynamic> ? args, List<SelectionNode> ? selections}) → FieldNode - Creates a FieldNode with simplified syntax.
-
fragmentDefinition(
String name, String typeCondition, {List< SelectionNode> ? selections}) → FragmentDefinitionNode - Creates a FragmentDefinitionNode for defining reusable fragments.
-
fragmentSpread(
String name) → FragmentSpreadNode - Creates a FragmentSpreadNode for referencing a named fragment.
-
getCacheStats(
) → Map< String, dynamic> - Returns cache statistics for performance monitoring.
-
inlineFragment(
String typeName, {List< SelectionNode> ? selections}) → InlineFragmentNode - Creates an InlineFragmentNode for type-specific selections.
-
nameNode(
String value) → NameNode - Creates or retrieves a cached NameNode for the given value.
-
operation(
OperationType type, String name, {List< VariableDefinitionNode> ? variables, List<SelectionNode> ? selections}) → OperationDefinitionNode - Creates an OperationDefinitionNode with simplified syntax.
-
selectionSet(
List< SelectionNode> selections) → SelectionSetNode - Creates a SelectionSetNode from a list of selections.
-
variable(
String name) → VariableNode - Creates a variable node for referencing a GraphQL variable.