fixed gql fragment bug

This commit is contained in:
Bachir Soussi Chiadmi 2022-02-24 20:58:32 +01:00
parent 3114581e31
commit 090be459ef
4 changed files with 8 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -34,12 +34,12 @@ export default createStore(Vuex.Store, {
// https://github.com/huybuidac/vuex-extensions // https://github.com/huybuidac/vuex-extensions
mixins: { mixins: {
actions: { actions: {
loadMaterialsGQL ({ dispatch }, { ids, gqlfragment, callBack, callBackArgs }) { loadMaterialsGQL ({ dispatch }, { ids, gqlfragment, gqlFragmentfields, callBack, callBackArgs }) {
console.log('loadMaterialsGQL ids', ids) console.log('loadMaterialsGQL ids', ids)
const ast = gql`{ const ast = gql`{
materiaux(ids: [${ids}]) { materiaux(ids: [${ids}]) {
...${gqlfragment} ...${gqlFragmentfields}
} }
} }
${gqlfragment} ${gqlfragment}

View File

@ -332,6 +332,7 @@ export default {
dispatch('loadMaterialsGQL', { dispatch('loadMaterialsGQL', {
ids: state.flagcolls[collid].items, ids: state.flagcolls[collid].items,
gqlfragment: materiauFlaglistGQL, gqlfragment: materiauFlaglistGQL,
gqlFragmentfields: 'MateriauFlagListFields',
callBack: 'loadMaterialsCallBack', callBack: 'loadMaterialsCallBack',
callBackArgs: { collid: collid } callBackArgs: { collid: collid }
}).then(() => { }).then(() => {
@ -370,6 +371,7 @@ export default {
dispatch('loadMaterialsGQL', { dispatch('loadMaterialsGQL', {
ids: state.flagcolls[collid].items, ids: state.flagcolls[collid].items,
gqlfragment: materiauFlaglistGQL, gqlfragment: materiauFlaglistGQL,
gqlFragmentfields: 'MateriauFlagListFields',
callBack: 'loadMaterialsCallBack', callBack: 'loadMaterialsCallBack',
callBackArgs: { collid: collid } callBackArgs: { collid: collid }
}) })