diff --git a/js/customElements/blogFooter.js b/js/customElements/blogFooter.js index 999f63584bfc447b727b0d0e5fcffac6d4e2d726..7d11c41193a9bf03319ac8251120a0ed7a80afdf 100644 --- a/js/customElements/blogFooter.js +++ b/js/customElements/blogFooter.js @@ -15,6 +15,7 @@ class blogFooter extends HTMLElement { var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let posts = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.blogPosts; posts.forEach((element) => { diff --git a/js/customElements/blogIndex.js b/js/customElements/blogIndex.js index a1a95cfaf935de618ba4ac2bce7a663766fae75d..342f08cffe85a20b65873d113602dc192cab2344 100644 --- a/js/customElements/blogIndex.js +++ b/js/customElements/blogIndex.js @@ -15,6 +15,7 @@ class BlogIndex extends HTMLElement { var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let posts = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.blogPosts; posts.forEach((element) => { diff --git a/js/customElements/commentsDisplay.js b/js/customElements/commentsDisplay.js index e301dd1799f9d3df274195b4cc1aefcee1dcc8de..3243502483b9d63517e6a02d0c51a51fd829a459 100644 --- a/js/customElements/commentsDisplay.js +++ b/js/customElements/commentsDisplay.js @@ -14,6 +14,7 @@ class commentsDisplay extends HTMLElement { var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let comments = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.comments; this.innerHTML = ""; diff --git a/js/customElements/contactMailButton.js b/js/customElements/contactMailButton.js index 5d1aa176d7e9ca91b63289db5bd71bafacda980f..b1f138f321c3e6466577fe5da3f0417f803a62ca 100644 --- a/js/customElements/contactMailButton.js +++ b/js/customElements/contactMailButton.js @@ -12,6 +12,7 @@ class contactMailButton extends HTMLElement { var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let sitekey = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.sitekey; diff --git a/js/customElements/ebkBanner.js b/js/customElements/ebkBanner.js index 2818b20302564e4117291ee0742b8657d70b04bd..2171dd335306ab14503f16f4594765bfb753c7d3 100644 --- a/js/customElements/ebkBanner.js +++ b/js/customElements/ebkBanner.js @@ -11,6 +11,7 @@ class ebkBanner extends HTMLElement { var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let elementCount = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.ebayKleinanzeigen.count; if(elementCount > 0) { diff --git a/js/customElements/newComment.js b/js/customElements/newComment.js index 54f0e4bd0b76e41823d987df4d814c3de0cd7e86..b7c372ff731be1d37f9f0552268b6a5645df8704 100644 --- a/js/customElements/newComment.js +++ b/js/customElements/newComment.js @@ -15,6 +15,7 @@ class newComment extends HTMLElement { var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let sitekey = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.sitekey; @@ -117,6 +118,7 @@ class newComment extends HTMLElement { var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let data = (await (await fetch("/API/graphql.php", requestOptions)).json()).data; if (data.newComment == "OK") { diff --git a/js/customElements/sellingTable.js b/js/customElements/sellingTable.js index bfd448292a62f95096b9b2717448ff864c35c28b..c9c11a6ecc2a78bf6ff1ce08b5ff0203b0957921 100644 --- a/js/customElements/sellingTable.js +++ b/js/customElements/sellingTable.js @@ -59,6 +59,7 @@ class sellingTable extends HTMLElement { var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let elements = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.ebayKleinanzeigen.elements; elements.forEach(ad => { diff --git a/js/customElements/skills.js b/js/customElements/skills.js index c37631b016f7d8cb658b51f096baf9776440d327..383952a8fb89802cc7a058f21d66f78cda82a7c2 100644 --- a/js/customElements/skills.js +++ b/js/customElements/skills.js @@ -11,6 +11,7 @@ class Skill extends HTMLElement { var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let skills = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.skills; diff --git a/js/viewPost.js b/js/viewPost.js index be5bda802fdf743bff1506722f59755d5dcbec07..15e8261046a408df987db402464a97ece15445ae 100644 --- a/js/viewPost.js +++ b/js/viewPost.js @@ -29,6 +29,7 @@ async function loadPost() { var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let post = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.blogPost; content.innerHTML = post["content"]; diff --git a/public/API/graphql.php b/public/API/graphql.php index 0e8190a8ebf72d3986a18f1103540b8c46c461f4..b778f21a64d014ea29aaeb3a9e3897ff2842c477 100644 --- a/public/API/graphql.php +++ b/public/API/graphql.php @@ -1,5 +1,5 @@ <?php -use GraphQL\GraphQL; +use GraphQL\Server\StandardServer; use GraphQL\Type\Schema; require 'vendor/autoload.php'; @@ -8,7 +8,8 @@ require "./lib/mysql.php"; require "./queries/queries.php"; $schema = new Schema([ - 'query' => $queryType + 'query' => $queryType, + 'mutation' => $mutationType, ]); try { diff --git a/public/impressum.html b/public/impressum.html index 62e7384222cf0dc431b1d07cefb48c381c2cf21e..c8246cdc745483b31ffb3bf61f79473f37807d92 100644 --- a/public/impressum.html +++ b/public/impressum.html @@ -59,6 +59,7 @@ var requestOptions = { method: 'POST', body: graphql, + headers: { 'Content-Type': 'application/json' } }; let mailAddress = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.mailAddress;