fixed gql api file: ->url() replaced by ->createFileUrl()
This commit is contained in:
		@@ -1046,7 +1046,10 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
 | 
				
			|||||||
  protected function addFile(ResolverRegistryInterface $registry, ResolverBuilder $builder) {
 | 
					  protected function addFile(ResolverRegistryInterface $registry, ResolverBuilder $builder) {
 | 
				
			||||||
    $registry->addFieldResolver('File', 'url',
 | 
					    $registry->addFieldResolver('File', 'url',
 | 
				
			||||||
      $builder->callback(function ($parent, $args) {
 | 
					      $builder->callback(function ($parent, $args) {
 | 
				
			||||||
        return $parent->url();
 | 
					        // $fileuri = $parent->getFileUri();
 | 
				
			||||||
 | 
					        $url = $parent->createFileUrl();
 | 
				
			||||||
 | 
					        // return $parent->url();
 | 
				
			||||||
 | 
					        return $url;
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
fragment MateriauFields on Materiau {
 | 
					fragment MateriauFlagListFields on Materiau {
 | 
				
			||||||
  id
 | 
					  id
 | 
				
			||||||
  title
 | 
					  title
 | 
				
			||||||
  path
 | 
					  path
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
fragment MateriauFields on Materiau {
 | 
					fragment MateriauModalFields on Materiau {
 | 
				
			||||||
  id
 | 
					  id
 | 
				
			||||||
  title
 | 
					  title
 | 
				
			||||||
	short_description
 | 
						short_description
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
fragment MateriauFields on Materiau {
 | 
					fragment MateriauSearchFields on Materiau {
 | 
				
			||||||
  id
 | 
					  id
 | 
				
			||||||
  title
 | 
					  title
 | 
				
			||||||
  short_description
 | 
					  short_description
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -305,7 +305,7 @@ import REST from 'vuejs/api/rest-axios'
 | 
				
			|||||||
import MGQ from 'vuejs/api/graphql-axios'
 | 
					import MGQ from 'vuejs/api/graphql-axios'
 | 
				
			||||||
import { print } from 'graphql/language/printer'
 | 
					import { print } from 'graphql/language/printer'
 | 
				
			||||||
import gql from 'graphql-tag'
 | 
					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')
 | 
					const prettyBytes = require('pretty-bytes')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -404,10 +404,10 @@ export default {
 | 
				
			|||||||
      this.loading = true
 | 
					      this.loading = true
 | 
				
			||||||
      const ast = gql`{
 | 
					      const ast = gql`{
 | 
				
			||||||
        materiau(id: ${this.item.id}, lang: "${drupalDecoupled.lang_code}") {
 | 
					        materiau(id: ${this.item.id}, lang: "${drupalDecoupled.lang_code}") {
 | 
				
			||||||
          ...MateriauFields
 | 
					          ...MateriauModalFields
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      ${materiauFields}
 | 
					      ${materiauModalFields}
 | 
				
			||||||
      `
 | 
					      `
 | 
				
			||||||
      MGQ.post('', { query: print(ast)
 | 
					      MGQ.post('', { query: print(ast)
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@ import REST from 'vuejs/api/rest-axios'
 | 
				
			|||||||
import MA from 'vuejs/api/ma-axios'
 | 
					import MA from 'vuejs/api/ma-axios'
 | 
				
			||||||
import qs from 'querystring-es3'
 | 
					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
 | 
					// import router from 'vuejs/route' // this is not working
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -331,7 +331,7 @@ export default {
 | 
				
			|||||||
              if (state.flagcolls[collid].items.length) {
 | 
					              if (state.flagcolls[collid].items.length) {
 | 
				
			||||||
                dispatch('loadMaterialsGQL', {
 | 
					                dispatch('loadMaterialsGQL', {
 | 
				
			||||||
                  ids: state.flagcolls[collid].items,
 | 
					                  ids: state.flagcolls[collid].items,
 | 
				
			||||||
                  gqlfragment: materiauGQL,
 | 
					                  gqlfragment: materiauFlaglistGQL,
 | 
				
			||||||
                  callBack: 'loadMaterialsCallBack',
 | 
					                  callBack: 'loadMaterialsCallBack',
 | 
				
			||||||
                  callBackArgs: { collid: collid }
 | 
					                  callBackArgs: { collid: collid }
 | 
				
			||||||
                }).then(() => {
 | 
					                }).then(() => {
 | 
				
			||||||
@@ -369,7 +369,7 @@ export default {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
          dispatch('loadMaterialsGQL', {
 | 
					          dispatch('loadMaterialsGQL', {
 | 
				
			||||||
            ids: state.flagcolls[collid].items,
 | 
					            ids: state.flagcolls[collid].items,
 | 
				
			||||||
            gqlfragment: materiauGQL,
 | 
					            gqlfragment: materiauFlaglistGQL,
 | 
				
			||||||
            callBack: 'loadMaterialsCallBack',
 | 
					            callBack: 'loadMaterialsCallBack',
 | 
				
			||||||
            callBackArgs: { collid: collid }
 | 
					            callBackArgs: { collid: collid }
 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user