Browse Source

gql added active field to entite paragraph

bach 1 month ago
parent
commit
8b514b0dd8

+ 1 - 0
src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.base.graphqls

@@ -40,6 +40,7 @@ type Entiteintegre {
   prise: Float
   id: Int
   revision_id: Int
+  active: Boolean
 }
 
 type Entite implements NodeInterface {

+ 8 - 0
src/web/modules/custom/ouatt_graphql/src/Plugin/GraphQL/SchemaExtension/OuattSchemaExtension.php

@@ -361,6 +361,14 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
       )
     );
     
+    // active: Boolean
+    $registry->addFieldResolver('Entiteintegre', 'active',
+      $builder->produce('property_path')
+        ->map('type', $builder->fromValue('entity:paragraph'))
+        ->map('value', $builder->fromParent())
+        ->map('path', $builder->fromValue('field_active.value'))
+      );
+
     $registry->addFieldResolver('Entiteintegre', 'actuelfuture',
       $builder->produce('property_path')
         ->map('type', $builder->fromValue('entity:paragraph'))