Automattic\WooCommerce\Vendor\GraphQL\Type

Introspection::typeNameMetaFieldDefpublic staticWC 1.0

Method of the class: Introspection{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = Introspection::typeNameMetaFieldDef(): FieldDefinition;

Introspection::typeNameMetaFieldDef() code WC 10.9.1

public static function typeNameMetaFieldDef(): FieldDefinition
{
    return self::$cachedInstances[self::TYPE_NAME_FIELD_NAME] ??= new FieldDefinition([
        'name' => self::TYPE_NAME_FIELD_NAME,
        'type' => Type::nonNull(Type::string()),
        'description' => 'The name of the current Object type at runtime.',
        'args' => [],
        'resolve' => static fn ($source, array $args, $context, ResolveInfo $info): string => $info->parentType->name,
    ]);
}