|
@@ -421,6 +421,23 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|
|
)
|
|
|
);
|
|
|
|
|
|
+ $registry->addFieldResolver('Query', 'userentites',
|
|
|
+ $builder->compose(
|
|
|
+ $builder->callback(function($parent, $arg){
|
|
|
+ $entity_storage = \Drupal::entityTypeManager()->getStorage('node');
|
|
|
+ $query = $entity_storage->getQuery()
|
|
|
+ ->condition('type', ['entite'], 'IN')
|
|
|
+ ->condition('uid', $arg['uid'])
|
|
|
+ ->accessCheck(TRUE);
|
|
|
+ $results = $query->execute();
|
|
|
+ return $results;
|
|
|
+ }),
|
|
|
+ $builder->produce('entity_load_multiple')
|
|
|
+ ->map('type', $builder->fromValue('node'))
|
|
|
+ ->map('ids', $builder->fromParent())
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
$registry->addFieldResolver('Query', 'entite',
|
|
|
$builder->produce('entity_load')
|
|
|
->map('type', $builder->fromValue('node'))
|