References TypeBuilder
Reference
C
Class

ApiPlatform\GraphQl\Type\TypeBuilder

Builds the GraphQL types.

class ApiPlatform\GraphQl\Type\TypeBuilder implements ApiPlatform\GraphQl\Type\ContextAwareTypeBuilderInterface
{
    public __construct($typesContainer, callable $defaultFieldResolver, Psr\Container\ContainerInterface $fieldsBuilderLocator, `<a href="/docs/main/references/State/Pagination/Pagination">ApiPlatform\State\Pagination\Pagination $pagination)
    public getResourceObjectType($resourceMetadataCollection, `<a href="/docs/main/references/Metadata/GraphQl/Operation">ApiPlatform\Metadata\GraphQl\Operation</a>` $operation, null|`<a href="/docs/main/references/Metadata/ApiProperty">ApiPlatform\Metadata\ApiProperty $propertyMetadata, array $context): 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

Parameters

typesContainer`ApiPlatform\GraphQl\Type\TypesContainerInterface`
defaultFieldResolvercallable
fieldsBuilderLocatorPsr\Container\ContainerInterface
pagination`ApiPlatform\State\Pagination\Pagination`

getResourceObjectType

Gets the object type of the given resource.

Parameters

resourceMetadataCollection`ApiPlatform\Metadata\Resource\ResourceMetadataCollection`
operation`ApiPlatform\Metadata\GraphQl\Operation`
propertyMetadata`ApiPlatform\Metadata\ApiProperty`
contextarray

Returns

GraphQL\Type\Definition\Type

getNodeInterface

Get the interface type of a node.

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

Returns

GraphQL\Type\Definition\InterfaceType

getResourcePaginatedCollectionType

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

Parameters

resourceTypeGraphQL\Type\Definition\Type
resourceClassstring
operation`ApiPlatform\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

Parameters

resourceTypeGraphQL\Type\Definition\Type
operation`ApiPlatform\Metadata\GraphQl\Operation`

Returns

GraphQL\Type\Definition\Type

getEnumType

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

Parameters

operation`ApiPlatform\Metadata\GraphQl\Operation`

Returns

GraphQL\Type\Definition\Type

isCollection

Returns true if a type is a collection.

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

Parameters

typeSymfony\Component\PropertyInfo\Type

Returns

bool

Made with love by

Les-Tilleuls.coop can help you design and develop your APIs and web projects, and train your teams in API Platform, Symfony, Next.js, Kubernetes and a wide range of other technologies.

Learn more

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop