Automattic\WooCommerce\Vendor\GraphQL\Utils

ASTDefinitionBuilder::makeSchemaDefprivateWC 1.0

Method of the class: ASTDefinitionBuilder{}

No Hooks.

Returns

CustomScalarType|EnumType|InputObjectType|InterfaceType|ObjectType|UnionType.

Usage

// private - for code of main (parent) class only
$result = $this->makeSchemaDef( $def ): Type;
$def(TypeDefinitionNode&Node) (required)
.

ASTDefinitionBuilder::makeSchemaDef() code WC 10.9.1

private function makeSchemaDef(Node $def): Type
{
    switch (true) {
        case $def instanceof ObjectTypeDefinitionNode:
            return $this->makeTypeDef($def);

        case $def instanceof InterfaceTypeDefinitionNode:
            return $this->makeInterfaceDef($def);

        case $def instanceof EnumTypeDefinitionNode:
            return $this->makeEnumDef($def);

        case $def instanceof UnionTypeDefinitionNode:
            return $this->makeUnionDef($def);

        case $def instanceof ScalarTypeDefinitionNode:
            return $this->makeScalarDef($def);

        default:
            assert($def instanceof InputObjectTypeDefinitionNode, 'all implementations are known');

            return $this->makeInputObjectDef($def);
    }
}