Automattic\WooCommerce\Vendor\GraphQL\Type

Introspection::_schemapublic staticWC 1.0

Method of the class: Introspection{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = Introspection::_schema(): ObjectType;

Introspection::_schema() code WC 10.9.1

public static function _schema(): ObjectType
{
    return self::$cachedInstances[self::SCHEMA_OBJECT_NAME] ??= new ObjectType([ // @phpstan-ignore missingType.checkedException (static configuration is known to be correct)
        'name' => self::SCHEMA_OBJECT_NAME,
        'isIntrospection' => true,
        'description' => 'A Automattic\WooCommerce\Vendor\GraphQL Schema defines the capabilities of a Automattic\WooCommerce\Vendor\GraphQL '
            . 'server. It exposes all available types and directives on '
            . 'the server, as well as the entry points for query, mutation, and '
            . 'subscription operations.',
        'fields' => [
            'description' => [
                'type' => Type::string(),
                'resolve' => static fn (Schema $schema): ?string => $schema->description,
            ],
            'types' => [
                'description' => 'A list of all types supported by this server.',
                'type' => new NonNull(new ListOfType(new NonNull(self::_type()))),
                'resolve' => static fn (Schema $schema): array => $schema->getTypeMap(),
            ],
            'queryType' => [
                'description' => 'The type that query operations will be rooted at.',
                'type' => new NonNull(self::_type()),
                'resolve' => static fn (Schema $schema): ?ObjectType => $schema->getQueryType(),
            ],
            'mutationType' => [
                'description' => 'If this server supports mutation, the type that mutation operations will be rooted at.',
                'type' => self::_type(),
                'resolve' => static fn (Schema $schema): ?ObjectType => $schema->getMutationType(),
            ],
            'subscriptionType' => [
                'description' => 'If this server support subscription, the type that subscription operations will be rooted at.',
                'type' => self::_type(),
                'resolve' => static fn (Schema $schema): ?ObjectType => $schema->getSubscriptionType(),
            ],
            'directives' => [
                'description' => 'A list of all directives supported by this server.',
                'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_directive()))),
                'resolve' => static fn (Schema $schema): array => $schema->getDirectives(),
            ],
        ],
    ]);
}