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();
);