set content type in graphql request
This commit is contained in:
parent
a6a470f8aa
commit
7b56fbbdcd
11 changed files with 14 additions and 2 deletions
|
@ -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) => {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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 = "";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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") {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"];
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue