瀏覽代碼

fixed gql api file: ->url() replaced by ->createFileUrl()

bach 2 年之前
父節點
當前提交
96b343b246

+ 4 - 1
web/modules/custom/materio_graphql/src/Plugin/GraphQL/SchemaExtension/MaterioSchemaExtension.php

@@ -1046,7 +1046,10 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
   protected function addFile(ResolverRegistryInterface $registry, ResolverBuilder $builder) {
     $registry->addFieldResolver('File', 'url',
       $builder->callback(function ($parent, $args) {
-        return $parent->url();
+        // $fileuri = $parent->getFileUri();
+        $url = $parent->createFileUrl();
+        // return $parent->url();
+        return $url;
       })
     );
 

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


二進制
web/themes/custom/materiotheme/assets/dist/main.js.gz


+ 1 - 1
web/themes/custom/materiotheme/vuejs/api/gql/materiauflaglist.fragment.gql

@@ -1,4 +1,4 @@
-fragment MateriauFields on Materiau {
+fragment MateriauFlagListFields on Materiau {
   id
   title
   path

+ 1 - 1
web/themes/custom/materiotheme/vuejs/api/gql/materiaumodal.fragment.gql

@@ -1,4 +1,4 @@
-fragment MateriauFields on Materiau {
+fragment MateriauModalFields on Materiau {
   id
   title
 	short_description

+ 1 - 1
web/themes/custom/materiotheme/vuejs/api/gql/materiausearch.fragment.gql

@@ -1,4 +1,4 @@
-fragment MateriauFields on Materiau {
+fragment MateriauSearchFields on Materiau {
   id
   title
   short_description

+ 3 - 3
web/themes/custom/materiotheme/vuejs/components/Content/ModalCard.vue

@@ -305,7 +305,7 @@ import REST from 'vuejs/api/rest-axios'
 import MGQ from 'vuejs/api/graphql-axios'
 import { print } from 'graphql/language/printer'
 import gql from 'graphql-tag'
-import materiauFields from 'vuejs/api/gql/materiaumodal.fragment.gql'
+import materiauModalFields from 'vuejs/api/gql/materiaumodal.fragment.gql'
 
 const prettyBytes = require('pretty-bytes')
 
@@ -404,10 +404,10 @@ export default {
       this.loading = true
       const ast = gql`{
         materiau(id: ${this.item.id}, lang: "${drupalDecoupled.lang_code}") {
-          ...MateriauFields
+          ...MateriauModalFields
         }
       }
-      ${materiauFields}
+      ${materiauModalFields}
       `
       MGQ.post('', { query: print(ast)
       })

+ 3 - 3
web/themes/custom/materiotheme/vuejs/store/modules/user.js

@@ -3,7 +3,7 @@ import REST from 'vuejs/api/rest-axios'
 import MA from 'vuejs/api/ma-axios'
 import qs from 'querystring-es3'
 
-import materiauGQL from 'vuejs/api/gql/materiauflaglist.fragment.gql'
+import materiauFlaglistGQL from 'vuejs/api/gql/materiauflaglist.fragment.gql'
 
 // import router from 'vuejs/route' // this is not working
 
@@ -331,7 +331,7 @@ export default {
               if (state.flagcolls[collid].items.length) {
                 dispatch('loadMaterialsGQL', {
                   ids: state.flagcolls[collid].items,
-                  gqlfragment: materiauGQL,
+                  gqlfragment: materiauFlaglistGQL,
                   callBack: 'loadMaterialsCallBack',
                   callBackArgs: { collid: collid }
                 }).then(() => {
@@ -369,7 +369,7 @@ export default {
 
           dispatch('loadMaterialsGQL', {
             ids: state.flagcolls[collid].items,
-            gqlfragment: materiauGQL,
+            gqlfragment: materiauFlaglistGQL,
             callBack: 'loadMaterialsCallBack',
             callBackArgs: { collid: collid }
           })

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