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
mixins: {
actions: {
loadMaterialsGQL ({ dispatch }, { ids, gqlfragment, callBack, callBackArgs }) {
loadMaterialsGQL ({ dispatch }, { ids, gqlfragment, gqlFragmentfields, callBack, callBackArgs }) {
console.log('loadMaterialsGQL ids', ids)
const ast = gql`{
materiaux(ids: [${ids}]) {
...${gqlfragment}
...${gqlFragmentfields}
}
}
${gqlfragment}

View File

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