Reference
C
Class

ApiPlatform\GraphQl\Type\TypeBuilder

Builds the GraphQL types.

class ApiPlatform\GraphQl\Type\TypeBuilder implements `<a href="/docs/reference/GraphQl/Type/TypeBuilderInterface">ApiPlatform\GraphQl\Type\TypeBuilderInterface</a>`, `<a href="/docs/reference/GraphQl/Type/TypeBuilderEnumInterface">ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface</a>`
{
    public __construct(ApiPlatform\GraphQl\Type\TypesContainerInterface $typesContainer, callable $defaultFieldResolver, Psr\Container\ContainerInterface $fieldsBuilderLocator, ApiPlatform\State\Pagination\Pagination $pagination)
    public getResourceObjectType(null|string $resourceClass, ApiPlatform\Metadata\Resource\ResourceMetadataCollection $resourceMetadataCollection, ApiPlatform\Metadata\GraphQl\Operation $operation, bool $input, bool $wrapped, int $depth): GraphQL\Type\Definition\Type
    public getNodeInterface(): GraphQL\Type\Definition\InterfaceType
    public getResourcePaginatedCollectionType(GraphQL\Type\Definition\Type $resourceType, string $resourceClass, ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type
    public getPaginatedCollectionType(GraphQL\Type\Definition\Type $resourceType, ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type
    public getEnumType(ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type
    public isCollection(Symfony\Component\PropertyInfo\Type $type): bool
}
class ApiPlatform\GraphQl\Type\TypeBuilder implements `<a href="/docs/reference/GraphQl/Type/TypeBuilderInterface">ApiPlatform\GraphQl\Type\TypeBuilderInterface</a>`, `<a href="/docs/reference/GraphQl/Type/TypeBuilderEnumInterface">ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface</a>`
{
    public __construct(ApiPlatform\GraphQl\Type\TypesContainerInterface $typesContainer, callable $defaultFieldResolver, Psr\Container\ContainerInterface $fieldsBuilderLocator, ApiPlatform\State\Pagination\Pagination $pagination)
    public getResourceObjectType(null|string $resourceClass, ApiPlatform\Metadata\Resource\ResourceMetadataCollection $resourceMetadataCollection, ApiPlatform\Metadata\GraphQl\Operation $operation, bool $input, bool $wrapped, int $depth): GraphQL\Type\Definition\Type
    public getNodeInterface(): GraphQL\Type\Definition\InterfaceType
    public getResourcePaginatedCollectionType(GraphQL\Type\Definition\Type $resourceType, string $resourceClass, ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type
    public getPaginatedCollectionType(GraphQL\Type\Definition\Type $resourceType, ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type
    public getEnumType(ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type
    public isCollection(Symfony\Component\PropertyInfo\Type $type): bool
}

Methods

__construct

public __construct(ApiPlatform\GraphQl\Type\TypesContainerInterface $typesContainer, callable $defaultFieldResolver, Psr\Container\ContainerInterface $fieldsBuilderLocator, ApiPlatform\State\Pagination\Pagination $pagination)
public __construct(ApiPlatform\GraphQl\Type\TypesContainerInterface $typesContainer, callable $defaultFieldResolver, Psr\Container\ContainerInterface $fieldsBuilderLocator, ApiPlatform\State\Pagination\Pagination $pagination)

Parameters

typesContainerApiPlatform\GraphQl\Type\TypesContainerInterface
defaultFieldResolvercallable
fieldsBuilderLocatorPsr\Container\ContainerInterface
paginationApiPlatform\State\Pagination\Pagination

getResourceObjectType

Gets the object type of the given resource.Gets the object type of the given resource.

public getResourceObjectType(null|string $resourceClass, ApiPlatform\Metadata\Resource\ResourceMetadataCollection $resourceMetadataCollection, ApiPlatform\Metadata\GraphQl\Operation $operation, bool $input, bool $wrapped, int $depth): GraphQL\Type\Definition\Type
public getResourceObjectType(null|string $resourceClass, ApiPlatform\Metadata\Resource\ResourceMetadataCollection $resourceMetadataCollection, ApiPlatform\Metadata\GraphQl\Operation $operation, bool $input, bool $wrapped, int $depth): GraphQL\Type\Definition\Type

Parameters

resourceClassstring
resourceMetadataCollectionApiPlatform\Metadata\Resource\ResourceMetadataCollection
operationApiPlatform\Metadata\GraphQl\Operation
inputbool
wrappedbool
depthint

Returns

GraphQL\Type\Definition\Type

getNodeInterface

Get the interface type of a node.Get the interface type of a node.

public getNodeInterface(): GraphQL\Type\Definition\InterfaceType
public getNodeInterface(): GraphQL\Type\Definition\InterfaceType

Returns

GraphQL\Type\Definition\InterfaceType

getResourcePaginatedCollectionType

Gets the type of a paginated collection of the given resource type.

public getResourcePaginatedCollectionType(GraphQL\Type\Definition\Type $resourceType, string $resourceClass, ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type
public getResourcePaginatedCollectionType(GraphQL\Type\Definition\Type $resourceType, string $resourceClass, ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type

Parameters

resourceTypeGraphQL\Type\Definition\Type
resourceClassstring
operationApiPlatform\Metadata\GraphQl\Operation

Returns

GraphQL\Type\Definition\Type

getPaginatedCollectionType

Gets the type of a paginated collection of the given resource type.

public getPaginatedCollectionType(GraphQL\Type\Definition\Type $resourceType, ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type
public getPaginatedCollectionType(GraphQL\Type\Definition\Type $resourceType, ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type

Parameters

resourceTypeGraphQL\Type\Definition\Type
operationApiPlatform\Metadata\GraphQl\Operation

Returns

GraphQL\Type\Definition\Type

getEnumType

public getEnumType(ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type
public getEnumType(ApiPlatform\Metadata\GraphQl\Operation $operation): GraphQL\Type\Definition\Type

Parameters

operationApiPlatform\Metadata\GraphQl\Operation

Returns

GraphQL\Type\Definition\Type

isCollection

Returns true if a type is a collection.Returns true if a type is a collection.

public isCollection(Symfony\Component\PropertyInfo\Type $type): bool
public isCollection(Symfony\Component\PropertyInfo\Type $type): bool

Parameters

typeSymfony\Component\PropertyInfo\Type

Returns

bool

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop