Skip to content

Category ​

Type
Class
Namespace
craft\gql\types\elements
Inherits
craft\gql\types\elements\Category » craft\gql\types\elements\Element » craft\gql\base\ObjectType » GraphQL\Type\Definition\ObjectType
Since
3.3.0

Class Category

View source

Public Methods ​

MethodDescription
__construct()
resolveWithDirectives()Resolve a value with the directives that apply to it.

__construct() ​

View source

Arguments ​

  • $config

Protected Methods ​

MethodDescription
elementResolverClass()Returns the \craft\gql\types\elements\ElementResolver class that should be used to build a schema-scoped element query for this type’s prev and next fields.
resolve()Resolve a field value with arguments, context and resolve information.

elementResolverClass() ​

Returns the \craft\gql\types\elements\ElementResolver class that should be used to build a schema-scoped element query for this type’s prev and next fields.

Subclasses that add prev/next fields to their GraphQL interface (see craft\gql\interfaces\elements\Entry for an example) should override this to return the \craft\gql\types\elements\ElementResolver class used to resolve their own top-level queries, so element navigation stays scoped to what the active schema is allowed to read.

Subclasses that don’t override this (the default) fall back to the unscoped getPrev()/getNext() behavior, for backwards compatibility with element types that predate this method.

View source

Returns ​

class-string<\craft\gql\base\ElementResolver>, null

resolve() ​

Resolve a field value with arguments, context and resolve information.

View source

Arguments ​

  • $source (mixed) – The parent data source to use for resolving this field
  • $arguments (array) – Arguments for resolving this field.
  • $context (mixed) – The context shared between all resolvers
  • $resolveInfo (\GraphQL\Type\Definition\ResolveInfo) – The resolve information

Returns ​

mixed – $result