$nodeType */ public function __construct( protected string $nodeType, ) { parent::__construct('node', nullable: false); } /** * The type returned by the field. */ public function baseType(): Type { $type = Str::of(class_basename($this->nodeType)) ->remove('Type') ->__toString(); return Type::nonNull(GraphQL::type($type)); } /** * Determine if the field should be displayed to the user. */ public function canBeDisplayed(): bool { return true; } }