Automattic\WooCommerce\Vendor\GraphQL\Type

Introspection::typeMetaFieldDefpublic staticWC 1.0

Method of the class: Introspection{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

Introspection::typeMetaFieldDef() code WC 10.9.1

public static function typeMetaFieldDef(): FieldDefinition
{
    return self::$cachedInstances[self::TYPE_FIELD_NAME] ??= new FieldDefinition([
        'name' => self::TYPE_FIELD_NAME,
        'type' => self::_type(),
        'description' => 'Request the type information of a single type.',
        'args' => [
            [
                'name' => 'name',
                'type' => Type::nonNull(Type::string()),
            ],
        ],
        'resolve' => static fn ($source, array $args, $context, ResolveInfo $info): ?Type => $info->schema->getType($args['name']),
    ]);
}