use graphql variables for postid
This commit is contained in:
parent
4fb15ec6d5
commit
49fa8a89b8
|
@ -27,8 +27,10 @@ async function loadPost() {
|
|||
content.innerHTML = "<h1>404 - Post not found</h1>";
|
||||
} else {
|
||||
var graphql = JSON.stringify({
|
||||
query: 'query {blogPost(id: "' + id + '") {content title}}',
|
||||
variables: {}
|
||||
query: 'query($postID: String!) {blogPost(id: $postID) {content title}}',
|
||||
variables: {
|
||||
"postID": id
|
||||
}
|
||||
})
|
||||
var requestOptions = {
|
||||
method: 'POST',
|
||||
|
|
Loading…
Reference in a new issue