add mutation query for new comment
This commit is contained in:
parent
bbc1fb852f
commit
aa670a0512
1 changed files with 18 additions and 12 deletions
|
@ -53,17 +53,6 @@ $queryType = new ObjectType([
|
||||||
],
|
],
|
||||||
'resolve' => fn ($rootValue, $args) => comments($args["article"], $rootValue["db"]),
|
'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' => [
|
'ebayKleinanzeigen' => [
|
||||||
"type" => $ebayKleinanzeigenFields,
|
"type" => $ebayKleinanzeigenFields,
|
||||||
"args" => [
|
"args" => [
|
||||||
|
@ -75,5 +64,22 @@ $queryType = new ObjectType([
|
||||||
'resolve' => fn ($rootValue, $args) => ebayKleinanzeigen($args["imageCount"]),
|
'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"]),
|
||||||
|
],
|
||||||
|
]
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue