Browse Source

added field_menu_burger to static gql queries

bach 2 years ago
parent
commit
67c9f1f46b

+ 1 - 0
src/web/modules/custom/enfrancais_graphql/graphql/enfr_extension.base.graphqls

@@ -102,6 +102,7 @@ type Static implements NodeInterface {
   texte: String
   notes: [Noteprod]
   fichiers: [File]
+  burger: Boolean
   poid: Int
 }
 

+ 7 - 0
src/web/modules/custom/enfrancais_graphql/src/Plugin/GraphQL/SchemaExtension/EnFrSchemaExtension.php

@@ -845,6 +845,13 @@ class EnFrSchemaExtension extends SdlSchemaExtensionPluginBase {
         ->map('field', $builder->fromValue('field_notes'))
       );
 
+    $registry->addFieldResolver('Static', 'burger',
+      $builder->produce('property_path')
+        ->map('type', $builder->fromValue('entity:node'))
+        ->map('value', $builder->fromParent())
+        ->map('path', $builder->fromValue('field_menu_burger.value'))
+    );
+
     $registry->addFieldResolver('Static', 'poid',
       $builder->produce('property_path')
         ->map('type', $builder->fromValue('entity:node'))