import { ALL_QUERY } from '../constants/graphql.js'
export default {
data(): {
return{
questions: [],
updateQuestions: []
}
},
methods: {
qwerty() {
if (this.questions.checkActive == undefined && this.questions.toLocation == undefined) {
let updateQuestions = this.questions.map(item => ({...item, checkActive: true, toLocation: false}))
this.updateQuestions = updateQuestions
}
},
apollo: {
questions: {
query: ALL_QUERY
}
}
}
Другой файл:
import gql from 'graphql-tag'
export const ALL_QUERY = gql`
query questions {
questions {
id
text
typeField
}
}
`