Browse Source

fixed gql products language selection

bach 3 years ago
parent
commit
14169ab24a

+ 2 - 0
web/modules/custom/materio_graphql/src/Plugin/GraphQL/SchemaExtension/MaterioSchemaExtension.php

@@ -1298,6 +1298,7 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
         ->map('type', $builder->fromValue('commerce_product'))
         // ->map('bundles', $builder->fromValue(['materiau']))
         ->map('id', $builder->fromArgument('id'))
+        ->map('language', $builder->fromArgument('lang'))
       );
 
     $registry->addFieldResolver('Query', 'products',
@@ -1305,6 +1306,7 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
         ->map('type', $builder->fromValue('commerce_product'))
         // ->map('bundles', $builder->fromValue(['materiau']))
         ->map('ids', $builder->fromArgument('ids'))
+        ->map('language', $builder->fromArgument('lang'))
     );
 
     $registry->addFieldResolver('Product', 'id',

File diff suppressed because it is too large
+ 0 - 0
web/themes/custom/materiotheme/assets/dist/main.js


BIN
web/themes/custom/materiotheme/assets/dist/main.js.gz


File diff suppressed because it is too large
+ 1 - 1
web/themes/custom/materiotheme/assets/dist/report.html


+ 1 - 1
web/themes/custom/materiotheme/vuejs/store/modules/pages.js

@@ -50,7 +50,7 @@ export default {
     },
     loadProducts ({ dispatch, commit, state }) {
       const ast = gql`{
-        products(ids: [${state.products_ids}]) {
+        products(ids: [${state.products_ids}], lang: "${drupalDecoupled.lang_code}") {
           ...ProductsFields
         }
       }

Some files were not shown because too many files changed in this diff