add base query for text cards
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
fragment TextCardFields on TextInterface {
|
||||||
|
id
|
||||||
|
bundle
|
||||||
|
title
|
||||||
|
content: texte
|
||||||
|
images {
|
||||||
|
id
|
||||||
|
url
|
||||||
|
alt
|
||||||
|
}
|
||||||
|
videos {
|
||||||
|
url
|
||||||
|
}
|
||||||
|
files: fichiers {
|
||||||
|
fid
|
||||||
|
filename
|
||||||
|
filemime
|
||||||
|
url
|
||||||
|
}
|
||||||
|
families: familles {
|
||||||
|
id
|
||||||
|
uuid
|
||||||
|
name
|
||||||
|
}
|
||||||
|
# field_titre
|
||||||
|
authors: auteurs {
|
||||||
|
id
|
||||||
|
uuid
|
||||||
|
name
|
||||||
|
}
|
||||||
|
edition {
|
||||||
|
id
|
||||||
|
uuid
|
||||||
|
name
|
||||||
|
}
|
||||||
|
type: __typename
|
||||||
|
}
|
||||||
@@ -1,5 +1,32 @@
|
|||||||
|
#import "../fragments/TextCardFields.gql"
|
||||||
|
|
||||||
query TextRef ($id: Int!) {
|
query TextRef ($id: Int!) {
|
||||||
textref (id: $id) {
|
text: texte (id: $id) {
|
||||||
title
|
...TextCardFields
|
||||||
|
|
||||||
|
... on Textref {
|
||||||
|
prods: text_produits {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
bounces: text_en_rebond {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
authors: auteurs {
|
||||||
|
name
|
||||||
|
}
|
||||||
|
edition {
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tags {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
# degres_detrangement: Int
|
||||||
|
notes {
|
||||||
|
note
|
||||||
|
numero
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export { default as TextsDepart } from './TextsDepart.gql'
|
export { default as TextsDepart } from './TextsDepart.gql'
|
||||||
export { default as TextRef } from './TextRef.gql'
|
export { default as TextCard } from './TextCard.gql'
|
||||||
export { default as TextdepartRecursive } from './TextdepartRecursive.gql'
|
export { default as TextdepartRecursive } from './TextdepartRecursive.gql'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { print } from 'graphql/language/printer'
|
import { print } from 'graphql/language/printer'
|
||||||
import {
|
import {
|
||||||
TextsDepart, TextRef, TextdepartRecursive
|
TextsDepart, TextCard, TextdepartRecursive
|
||||||
} from '@/api/queries'
|
} from '@/api/queries'
|
||||||
import TextdepartRecursiveWithDepth from '@/api/queries/TextdepartRecursiveWithDepth.gql'
|
import TextdepartRecursiveWithDepth from '@/api/queries/TextdepartRecursiveWithDepth.gql'
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
'GET_TEXT' (store, { id }) {
|
'GET_TEXT' (store, { id }) {
|
||||||
return api.post('', { query: print(TextRef), variables: { id } })
|
return api.post('', { query: print(TextCard), variables: { id } })
|
||||||
.then(data => (data.data.data))
|
.then(data => (data.data.data.text))
|
||||||
},
|
},
|
||||||
|
|
||||||
'GET_TREE' (store, id) {
|
'GET_TREE' (store, id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user