|
@@ -1,7 +1,7 @@
|
|
import axios from 'axios'
|
|
import axios from 'axios'
|
|
import { print } from 'graphql/language/printer'
|
|
import { print } from 'graphql/language/printer'
|
|
|
|
|
|
-import { Node, Nodes, NodesTrees } from '@/api/queries'
|
|
|
|
|
|
+import { Node, Nodes, AllNodesOfVariant, NodesTrees } from '@/api/queries'
|
|
import * as nodesFragments from '@/api/fragments'
|
|
import * as nodesFragments from '@/api/fragments'
|
|
|
|
|
|
|
|
|
|
@@ -45,6 +45,13 @@ export default {
|
|
}).then(response => response.data.data)
|
|
}).then(response => response.data.data)
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ queryAllNodes (variantId, levels) {
|
|
|
|
+ return api.post('', {
|
|
|
|
+ query: this.getQueryString(AllNodesOfVariant, levels),
|
|
|
|
+ variables: { variantId }
|
|
|
|
+ }).then(response => response.data.data)
|
|
|
|
+ },
|
|
|
|
+
|
|
queryRecursiveNodes (ids, depth = 4) {
|
|
queryRecursiveNodes (ids, depth = 4) {
|
|
const baseQuery = print(NodesTrees)
|
|
const baseQuery = print(NodesTrees)
|
|
const prodFragment = `
|
|
const prodFragment = `
|