frist graphql query to materio_graphql schema is working
going to refactor every thing with graphql
This commit is contained in:
@ -0,0 +1,32 @@
|
||||
fragment ArticleFields on Article {
|
||||
images {
|
||||
id
|
||||
url
|
||||
alt
|
||||
style_minicard{
|
||||
width
|
||||
height
|
||||
url
|
||||
}
|
||||
}
|
||||
id
|
||||
title
|
||||
author
|
||||
uuid
|
||||
memo
|
||||
linked_materials {
|
||||
id
|
||||
title
|
||||
memo
|
||||
images {
|
||||
id
|
||||
url
|
||||
alt
|
||||
style_minicard{
|
||||
width
|
||||
height
|
||||
url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
fragment MateriauFields on Materiau {
|
||||
images {
|
||||
id
|
||||
url
|
||||
alt
|
||||
style_minicard{
|
||||
width
|
||||
height
|
||||
url
|
||||
}
|
||||
}
|
||||
id
|
||||
title
|
||||
author
|
||||
uuid
|
||||
memo
|
||||
linked_materials {
|
||||
id
|
||||
title
|
||||
memo
|
||||
images {
|
||||
id
|
||||
url
|
||||
alt
|
||||
style_minicard{
|
||||
width
|
||||
height
|
||||
url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
17
web/themes/custom/materiotheme/vuejs/api/graphql-axios.js
Normal file
17
web/themes/custom/materiotheme/vuejs/api/graphql-axios.js
Normal file
@ -0,0 +1,17 @@
|
||||
import axios from 'axios'
|
||||
|
||||
// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
|
||||
|
||||
// console.log('drupalSettings', drupalSettings);
|
||||
console.log(window.location);
|
||||
|
||||
export const MGQ = axios.create({
|
||||
baseURL: window.location.origin+`/mgq`,
|
||||
withCredentials: true,
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
// Accept: 'application/vnd.api+json'
|
||||
// Authorization: 'Basic {token}',
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user