Skip to content

Directive ​

Type
Abstract Class
Namespace
craft\gql\base
Inherits
craft\gql\base\Directive » GraphQL\Type\Definition\Directive
Extended by
craft\gql\directives\FormatDateTime, craft\gql\directives\Markdown, craft\gql\directives\Money, craft\gql\directives\ParseRefs, craft\gql\directives\StripTags, craft\gql\directives\Transform, craft\gql\directives\Trim, craft\test\mockclasses\gql\MockDirective
Since
3.3.0

Class Directive

View source

Public Methods ​

MethodDescription
apply()Apply the directive to the value with arguments
create()Return an instance of the directive
name()Return the directive's name

apply() ​

Apply the directive to the value with arguments

View source

Arguments ​

  • $source (mixed) – The original source from which the value was resolved
  • $value (mixed) – The value that was resolved
  • $arguments (array) – For the directive
  • $resolveInfo (\GraphQL\Type\Definition\ResolveInfo) – Resolve info object

Returns ​

mixed

create() ​

Return an instance of the directive

View source

Returns ​

\GraphQL\Type\Definition\Directive – $directive

name() ​

Return the directive's name

View source

Returns ​

string – $name