References TypeConverter
Reference
C
Class

ApiPlatform\GraphQl\Type\TypeConverter

Converts a type to its GraphQL equivalent.

Methods

__construct

Parameters

typeBuilder`ApiPlatform\GraphQl\Type\ContextAwareTypeBuilderInterface`
`ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface`
`ApiPlatform\GraphQl\Type\TypeBuilderInterface`
typesContainer`ApiPlatform\GraphQl\Type\TypesContainerInterface`
resourceMetadataCollectionFactory`ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface`
propertyMetadataFactory`ApiPlatform\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

Parameters

typeSymfony\Component\PropertyInfo\Type
inputbool
rootOperation`ApiPlatform\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

Parameters

typestring

Returns

GraphQL\Type\Definition\Type

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