Skip to content
Snippets Groups Projects
Commit aa670a05 authored by Jonas Leder's avatar Jonas Leder
Browse files

add mutation query for new comment

parent bbc1fb85
No related branches found
No related tags found
No related merge requests found
......@@ -53,17 +53,6 @@ $queryType = new ObjectType([
],
'resolve' => fn ($rootValue, $args) => comments($args["article"], $rootValue["db"]),
],
"newComment" => [
"type" => Type::string(),
"args" => [
"article" => Type::string(),
"name" => Type::string(),
"email" => Type::string(),
"comment" => Type::string(),
"hCaptchaResponse" => Type::string()
],
'resolve' => fn ($rootValue, $args) => newComment($rootValue["db"], $args["article"], $args["name"], $args["email"], $args["comment"], $args["hCaptchaResponse"]),
],
'ebayKleinanzeigen' => [
"type" => $ebayKleinanzeigenFields,
"args" => [
......@@ -75,5 +64,22 @@ $queryType = new ObjectType([
'resolve' => fn ($rootValue, $args) => ebayKleinanzeigen($args["imageCount"]),
]
],
]
]);
$mutationType = new ObjectType([
'name' => 'Mutation',
'fields' => [
"comment" => [
"type" => Type::string(),
"args" => [
"article" => Type::string(),
"name" => Type::string(),
"email" => Type::string(),
"comment" => Type::string(),
"hCaptchaResponse" => Type::string()
],
'resolve' => fn ($rootValue, $args) => newComment($rootValue["db"], $args["article"], $args["name"], $args["email"], $args["comment"], $args["hCaptchaResponse"]),
],
]
]);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment