public static function _directive()
{
if (!isset(self::$map['__Directive'])) {
self::$map['__Directive'] = new ObjectType(['name' => '__Directive', 'description' => 'A Directive provides a way to describe alternate runtime execution and ' . 'type validation behavior in a GraphQL document.' . '\\n\\nIn some cases, you need to provide options to alter GraphQL’s ' . 'execution behavior in ways field arguments will not suffice, such as ' . 'conditionally including or skipping a field. Directives provide this by ' . 'describing additional information to the executor.', 'fields' => ['name' => ['type' => Type::nonNull(Type::string())], 'description' => ['type' => Type::string()], 'locations' => ['type' => Type::nonNull(Type::listOf(Type::nonNull(self::_directiveLocation())))], 'args' => ['type' => Type::nonNull(Type::listOf(Type::nonNull(self::_inputValue()))), 'resolve' => function (Directive $directive) {
return $directive->args ?: [];
}], 'onOperation' => ['deprecationReason' => 'Use `locations`.', 'type' => Type::nonNull(Type::boolean()), 'resolve' => function ($d) {
return in_array(DirectiveLocation::QUERY, $d->locations) || in_array(DirectiveLocation::MUTATION, $d->locations) || in_array(DirectiveLocation::SUBSCRIPTION, $d->locations);
}], 'onFragment' => ['deprecationReason' => 'Use `locations`.', 'type' => Type::nonNull(Type::boolean()), 'resolve' => function ($d) {
return in_array(DirectiveLocation::FRAGMENT_SPREAD, $d->locations) || in_array(DirectiveLocation::INLINE_FRAGMENT, $d->locations) || in_array(DirectiveLocation::FRAGMENT_DEFINITION, $d->locations);
}], 'onField' => ['deprecationReason' => 'Use `locations`.', 'type' => Type::nonNull(Type::boolean()), 'resolve' => function ($d) {
return in_array(DirectiveLocation::FIELD, $d->locations);
}]]]);
}
return self::$map['__Directive'];
}