Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -10,41 +10,52 @@
|
||||
*/
|
||||
|
||||
namespace IPS\forums\api\GraphQL;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\Types;
|
||||
use IPS\forums\api\GraphQL\Mutations\CreateTopic;
|
||||
use IPS\forums\api\GraphQL\Mutations\MarkForumRead;
|
||||
use IPS\forums\api\GraphQL\Mutations\MarkTopicRead;
|
||||
use IPS\forums\api\GraphQL\Mutations\MarkTopicSolved;
|
||||
use IPS\forums\api\GraphQL\Mutations\PostReaction;
|
||||
use IPS\forums\api\GraphQL\Mutations\ReplyTopic;
|
||||
use IPS\forums\api\GraphQL\Mutations\ReportPost;
|
||||
use IPS\forums\api\GraphQL\Mutations\RevokePostReport;
|
||||
use IPS\forums\api\GraphQL\Mutations\SetBestAnswer;
|
||||
use IPS\forums\api\GraphQL\Mutations\VoteAnswer;
|
||||
use IPS\forums\api\GraphQL\Mutations\VoteInPoll;
|
||||
use IPS\forums\api\GraphQL\Mutations\VoteQuestion;
|
||||
use function defined;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Forums mutationss GraphQL API
|
||||
*/
|
||||
abstract class _Mutation
|
||||
abstract class Mutation
|
||||
{
|
||||
/**
|
||||
* Get the supported query types in this app
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function mutations()
|
||||
public static function mutations() : array
|
||||
{
|
||||
return [
|
||||
'createTopic' => new \IPS\forums\api\GraphQL\Mutations\CreateTopic(),
|
||||
'replyTopic' => new \IPS\forums\api\GraphQL\Mutations\ReplyTopic(),
|
||||
'postReaction' => new \IPS\forums\api\GraphQL\Mutations\PostReaction(),
|
||||
'markForumRead' => new \IPS\forums\api\GraphQL\Mutations\MarkForumRead(),
|
||||
'markTopicRead' => new \IPS\forums\api\GraphQL\Mutations\MarkTopicRead(),
|
||||
'markTopicSolved' => new \IPS\forums\api\GraphQL\Mutations\MarkTopicSolved(),
|
||||
'voteInPoll' => new \IPS\forums\api\GraphQL\Mutations\VoteInPoll(),
|
||||
'voteQuestion' => new \IPS\forums\api\GraphQL\Mutations\VoteQuestion(),
|
||||
'voteAnswer' => new \IPS\forums\api\GraphQL\Mutations\VoteAnswer(),
|
||||
'setBestAnswer' => new \IPS\forums\api\GraphQL\Mutations\SetBestAnswer(),
|
||||
'reportPost' => new \IPS\forums\api\GraphQL\Mutations\ReportPost(),
|
||||
'revokePostReport' => new \IPS\forums\api\GraphQL\Mutations\RevokePostReport(),
|
||||
'createTopic' => new CreateTopic(),
|
||||
'replyTopic' => new ReplyTopic(),
|
||||
'postReaction' => new PostReaction(),
|
||||
'markForumRead' => new MarkForumRead(),
|
||||
'markTopicRead' => new MarkTopicRead(),
|
||||
'markTopicSolved' => new MarkTopicSolved(),
|
||||
'voteInPoll' => new VoteInPoll(),
|
||||
'voteQuestion' => new VoteQuestion(),
|
||||
'voteAnswer' => new VoteAnswer(),
|
||||
'setBestAnswer' => new SetBestAnswer(),
|
||||
'reportPost' => new ReportPost(),
|
||||
'revokePostReport' => new RevokePostReport(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user