You are here

public static function TypedDataTypeResolver::getPropertyComplexValue in GraphQL 8.2

Same name and namespace in other branches
  1. 8 src/TypeResolver/TypedDataTypeResolver.php \Drupal\graphql\TypeResolver\TypedDataTypeResolver::getPropertyComplexValue()

Property value resolver callback for complex properties

Parameters

\Drupal\Core\TypedData\ComplexDataInterface $data: The parent complex data structure to extract the property from.

Return value

\Drupal\Core\TypedData\ComplexDataInterface|null The resolved value.

File

src/TypeResolver/TypedDataTypeResolver.php, line 316

Class

TypedDataTypeResolver
Generically resolves the schema for typed data types.

Namespace

Drupal\graphql\TypeResolver

Code

public static function getPropertyComplexValue(ComplexDataInterface $data = NULL, $a, $b, $c, $d, $e, $f, $config) {
  if (!isset($data)) {
    return NULL;
  }
  $value = $data
    ->get($config['property']);
  if ($value instanceof AccessibleInterface && !$value
    ->access('view')) {
    return NULL;
  }
  return $value;
}