public static function TypedDataTypeResolver::getPropertyListValue in GraphQL 8.2
Same name and namespace in other branches
- 8 src/TypeResolver/TypedDataTypeResolver.php \Drupal\graphql\TypeResolver\TypedDataTypeResolver::getPropertyListValue()
Property value resolver callback for list properties.
Parameters
\Drupal\Core\TypedData\ComplexDataInterface $data: The parent complex data structure to extract the property from.
Return value
array The resolved value.
File
- src/
TypeResolver/ TypedDataTypeResolver.php, line 338
Class
- TypedDataTypeResolver
- Generically resolves the schema for typed data types.
Namespace
Drupal\graphql\TypeResolverCode
public static function getPropertyListValue(ComplexDataInterface $data = NULL, $a, $b, $c, $d, $e, $f, $config) {
if (!isset($data)) {
return NULL;
}
/** @var \Drupal\Core\TypedData\ListInterface $value */
$value = $data
->get($config['property']);
if ($value instanceof AccessibleInterface && !$value
->access('view')) {
return NULL;
}
return iterator_to_array($value);
}