for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Digia\GraphQL\Type;
use Digia\GraphQL\GraphQL;
use Digia\GraphQL\Type\Definition\NamedTypeInterface;
use Digia\GraphQL\Type\Definition\ScalarType;
use function Digia\GraphQL\Util\arraySome;
/**
* @return ScalarType
*/
function BooleanType(): ScalarType
{
return GraphQL::make('GraphQLBoolean');
}
function FloatType(): ScalarType
return GraphQL::make('GraphQLFloat');
function IntType(): ScalarType
return GraphQL::make('GraphQLInt');
function IDType(): ScalarType
return GraphQL::make('GraphQLID');
function StringType(): ScalarType
return GraphQL::make('GraphQLString');
* @return array
function specifiedScalarTypes(): array
return [
StringType(),
IntType(),
FloatType(),
BooleanType(),
IDType(),
];
* @param NamedTypeInterface $type
* @return bool
function isSpecifiedScalarType(NamedTypeInterface $type): bool
return arraySome(
specifiedScalarTypes(),
function (ScalarType $specifiedScalarType) use ($type) {
return $type->getName() === $specifiedScalarType->getName();
);