Bläddra i källkod

gql reponse confidentialite field

bach 5 månader sedan
förälder
incheckning
c3b9a1cc76

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

@@ -108,6 +108,7 @@ type Reponse implements NodeInterface {
   quoi: String
   ou: String
   avec: String
+  confidentialite: String
 }
 
 type Doleance implements NodeInterface {

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

@@ -937,6 +937,14 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
         })
       )
     );
+
+    $registry->addFieldResolver('Reponse', 'confidentialite',
+      $builder->produce('property_path')
+        ->map('type', $builder->fromValue('entity:node'))
+        ->map('value', $builder->fromParent())
+        ->map('path', $builder->fromValue('field_confidentialite.value'))
+      );
+
   }
 
   //   ____        _