|
@@ -815,6 +815,22 @@ class EnFrSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|
|
// |_|\__,_\__, |
|
|
|
// |___/
|
|
|
protected function addTaxoterm(ResolverRegistryInterface $registry, ResolverBuilder $builder) {
|
|
|
+ $registry->addFieldResolver('Query', 'alltags',
|
|
|
+ $builder->compose(
|
|
|
+ $builder->callback(function($parent, $arg){
|
|
|
+ $entity_storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term');
|
|
|
+ $query = $entity_storage->getQuery()
|
|
|
+ ->condition('vid', ['tags', 'tag_prod'], 'IN')
|
|
|
+ ->accessCheck(TRUE);
|
|
|
+ $results = $query->execute();
|
|
|
+ return $results;
|
|
|
+ }),
|
|
|
+ $builder->produce('entity_load_multiple')
|
|
|
+ ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
+ ->map('ids', $builder->fromParent())
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
$registry->addFieldResolver('Query', 'tag',
|
|
|
$builder->produce('entity_load')
|
|
|
->map('type', $builder->fromValue('taxonomy_term'))
|