for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Digia\GraphQL\GraphQLRuntime;
use Digia\GraphQL\Type\Definition\Directive;
use Digia\GraphQL\Type\Definition\DirectiveInterface;
use function Digia\GraphQL\Util\arraySome;
/**
* @return Directive
* @throws TypeError
*/
function GraphQLIncludeDirective(): Directive
{
return GraphQLRuntime::make('GraphQLIncludeDirective');
}
function GraphQLSkipDirective(): Directive
return GraphQLRuntime::make('GraphQLSkipDirective');
const DEFAULT_DEPRECATION_REASON = 'No longer supported';
function GraphQLDeprecatedDirective(): Directive
return GraphQLRuntime::make('GraphQLDeprecatedDirective');
* @return array
function specifiedDirectives(): array
return [
GraphQLIncludeDirective(),
GraphQLSkipDirective(),
GraphQLDeprecatedDirective(),
];
* @param DirectiveInterface $directive
* @return bool
* @throws ReflectionException
function isSpecifiedDirective(DirectiveInterface $directive): bool
return arraySome(
specifiedDirectives(),
function (DirectiveInterface $specifiedDirective) use ($directive) {
return $specifiedDirective->getName() === $directive->getName();
);