kandimat-user-app/src/app/euromat/helper.js
2020-06-14 03:33:39 +02:00

34 lines
560 B
JavaScript

import gql from 'graphql-tag'
export const apolloTheses = {
query: gql`{
allQuestions(orderBy: ID_ASC) {
nodes {
category: categoryByCategoryId {
title
}
text
id
}
}
}`,
update: data => data.allQuestions.nodes.map(node => ({
id: node.id,
thesis: {
de: node.text
},
category: {
de: node.category.title
}
}))
}
export const apolloThesesCount = {
query: gql`{
allQuestions {
totalCount
}
}`,
update: data => data.allQuestions.totalCount
}