Browse Source

gql added uuid to source (paragraph)

bach 7 months ago
parent
commit
de193b08b6

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

@@ -64,6 +64,7 @@ type Entite implements NodeInterface {
 
 type Source {
   id: Int!
+  uuid: String!
   audios: [Filefield]
   date: Date
   documents: [Filefield]

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

@@ -600,6 +600,11 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
         ->map('entity', $builder->fromParent())
       );
     
+    $registry->addFieldResolver('Source', 'uuid',
+      $builder->produce('entity_uuid')
+        ->map('entity', $builder->fromParent())
+      );
+
     $registry->addFieldResolver('Source', 'description',
       $builder->produce('property_path')
         ->map('type', $builder->fromValue('entity:paragraph'))