Converts a type to its GraphQL equivalent.
class ApiPlatform\GraphQl\Type\TypeConverter implements ApiPlatform\GraphQl\Type\TypeConverterInterface
{
public __construct(|`<a href="/docs/main/references/GraphQl/Type/TypeBuilderEnumInterface">ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface</a>`|`<a href="/docs/main/references/GraphQl/Type/TypeBuilderInterface">ApiPlatform\GraphQl\Type\TypeBuilderInterface</a>` $typeBuilder, `<a href="/docs/main/references/GraphQl/Type/TypesContainerInterface">ApiPlatform\GraphQl\Type\TypesContainerInterface</a>` $typesContainer, `<a href="/docs/main/references/Metadata/Resource/Factory/ResourceMetadataCollectionFactoryInterface">ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface</a>` $resourceMetadataCollectionFactory, `<a href="/docs/main/references/Metadata/Property/Factory/PropertyMetadataFactoryInterface">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
}
public __construct(|`<a href="/docs/main/references/GraphQl/Type/TypeBuilderEnumInterface">ApiPlatform\GraphQl\Type\TypeBuilderEnumInterface</a>`|`<a href="/docs/main/references/GraphQl/Type/TypeBuilderInterface">ApiPlatform\GraphQl\Type\TypeBuilderInterface</a>` $typeBuilder, `<a href="/docs/main/references/GraphQl/Type/TypesContainerInterface">ApiPlatform\GraphQl\Type\TypesContainerInterface</a>` $typesContainer, `<a href="/docs/main/references/Metadata/Resource/Factory/ResourceMetadataCollectionFactoryInterface">ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface</a>` $resourceMetadataCollectionFactory, `<a href="/docs/main/references/Metadata/Property/Factory/PropertyMetadataFactoryInterface">ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory)
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` |
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
type | Symfony\Component\PropertyInfo\Type | |
input | bool | |
rootOperation | `ApiPlatform\Metadata\GraphQl\Operation` | |
resourceClass | string | |
rootResource | string | |
property | string | |
depth | int |
GraphQL\Type\Definition\Type
string
Resolves a type written with the GraphQL type system to its object representation.
public resolveType(string $type): GraphQL\Type\Definition\Type
type | string |
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