Reference
C
Class

ApiPlatform\GraphQl\Type\TypeConverter

Converts a type to its GraphQL equivalent.

class ApiPlatform\GraphQl\Type\TypeConverter implements `<a href="/docs/reference/GraphQl/Type/TypeConverterInterface">ApiPlatform\GraphQl\Type\TypeConverterInterface</a>`
{
    public __construct(ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface|ApiPlatform\GraphQl\Type\TypeBuilderInterface $typeBuilder, ApiPlatform\GraphQl\Type\TypesContainerInterface $typesContainer, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory)
    public convertType(Symfony\Component\PropertyInfo\Type $type, bool $input, ApiPlatform\Metadata\GraphQl\Operation $rootOperation, string $resourceClass, string $rootResource, null|string $property, int $depth): GraphQL\Type\Definition\Type|string
    public resolveType(string $type): GraphQL\Type\Definition\Type
}
class ApiPlatform\GraphQl\Type\TypeConverter implements `<a href="/docs/reference/GraphQl/Type/TypeConverterInterface">ApiPlatform\GraphQl\Type\TypeConverterInterface</a>`
{
    public __construct(ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface|ApiPlatform\GraphQl\Type\TypeBuilderInterface $typeBuilder, ApiPlatform\GraphQl\Type\TypesContainerInterface $typesContainer, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory)
    public convertType(Symfony\Component\PropertyInfo\Type $type, bool $input, ApiPlatform\Metadata\GraphQl\Operation $rootOperation, string $resourceClass, string $rootResource, null|string $property, int $depth): GraphQL\Type\Definition\Type|string
    public resolveType(string $type): GraphQL\Type\Definition\Type
}

Methods

__construct

public __construct(ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface|ApiPlatform\GraphQl\Type\TypeBuilderInterface $typeBuilder, ApiPlatform\GraphQl\Type\TypesContainerInterface $typesContainer, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory)
public __construct(ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface|ApiPlatform\GraphQl\Type\TypeBuilderInterface $typeBuilder, ApiPlatform\GraphQl\Type\TypesContainerInterface $typesContainer, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory)

Parameters

typeBuilderApiPlatform\GraphQl\Type\TypeBuilderEnumInterface
ApiPlatform\GraphQl\Type\TypeBuilderInterface
typesContainerApiPlatform\GraphQl\Type\TypesContainerInterface
resourceMetadataCollectionFactoryApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface
propertyMetadataFactoryApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface

convertType

Converts a built-in type to its GraphQL equivalent. A string can be returned for a custom registered type.

public convertType(Symfony\Component\PropertyInfo\Type $type, bool $input, ApiPlatform\Metadata\GraphQl\Operation $rootOperation, string $resourceClass, string $rootResource, null|string $property, int $depth): GraphQL\Type\Definition\Type|string
public convertType(Symfony\Component\PropertyInfo\Type $type, bool $input, ApiPlatform\Metadata\GraphQl\Operation $rootOperation, string $resourceClass, string $rootResource, null|string $property, int $depth): GraphQL\Type\Definition\Type|string

Parameters

typeSymfony\Component\PropertyInfo\Type
inputbool
rootOperationApiPlatform\Metadata\GraphQl\Operation
resourceClassstring
rootResourcestring
propertystring
depthint

Returns

GraphQL\Type\Definition\Type
string

resolveType

Resolves a type written with the GraphQL type system to its object representation.

public resolveType(string $type): GraphQL\Type\Definition\Type
public resolveType(string $type): GraphQL\Type\Definition\Type

Parameters

typestring

Returns

GraphQL\Type\Definition\Type

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop