瀏覽代碼

fix gql query text: Textinterface

bach 3 年之前
父節點
當前提交
e7c7292ffd

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

@@ -7,7 +7,7 @@ extend type Query {
 }
 
 extend type Query {
-  text(id: Int!): TextInterface
+  texte(id: Int!): TextInterface
 }
 
 extend type Query {

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

@@ -143,10 +143,10 @@ class EnFrSchemaExtension extends SdlSchemaExtensionPluginBase {
         )
     );
 
-    $registry->addFieldResolver('Query', 'text',
+    $registry->addFieldResolver('Query', 'texte',
       $builder->produce('entity_load')
         ->map('type', $builder->fromValue('node'))
-        ->map('id', $builder->fromParent())
+        ->map('id', $builder->fromArgument('id'))
     );
   }