nameNode static method
Creates or retrieves a cached NameNode for the given value.
This method implements intelligent caching to reuse common NameNode instances like field names, operation names, and argument names.
Example:
final nameNode = DocumentNodeHelpers.nameNode('pokemon');
Implementation
static NameNode nameNode(String value) {
// Implement cache size management
if (_nameNodeCache.length >= _maxCacheSize) {
_clearOldestCacheEntries();
}
return _nameNodeCache.putIfAbsent(value, () => NameNode(value: value));
}