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,25 +10,28 @@
|
||||
*/
|
||||
|
||||
namespace IPS\core\api\GraphQL\Queries;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use GraphQL\Type\Definition\ListOfType;
|
||||
use IPS\Api\GraphQL\TypeRegistry;
|
||||
use IPS\core\api\GraphQL\Types\MessengerFolderType;
|
||||
use IPS\Member;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Messenger folders query for GraphQL API
|
||||
*/
|
||||
class _MessengerFolders
|
||||
class MessengerFolders
|
||||
{
|
||||
/*
|
||||
* @brief Query description
|
||||
*/
|
||||
public static $description = "Returns the member's messenger folders";
|
||||
public static string $description = "Returns the member's messenger folders";
|
||||
|
||||
/*
|
||||
* Query arguments
|
||||
@@ -42,8 +45,10 @@ class _MessengerFolders
|
||||
|
||||
/**
|
||||
* Return the query return type
|
||||
*
|
||||
* @return ListOfType<MessengerFolderType>
|
||||
*/
|
||||
public function type()
|
||||
public function type() : ListOfType
|
||||
{
|
||||
return TypeRegistry::listOf( \IPS\core\api\GraphQL\TypeRegistry::messengerFolder() );
|
||||
}
|
||||
@@ -51,14 +56,15 @@ class _MessengerFolders
|
||||
/**
|
||||
* Resolves this query
|
||||
*
|
||||
* @param mixed Value passed into this resolver
|
||||
* @param array Arguments
|
||||
* @param array Context values
|
||||
* @return \IPS\core\Messenger\Conversation
|
||||
* @param mixed $val Value passed into this resolver
|
||||
* @param array $args Arguments
|
||||
* @param array $context Context values
|
||||
* @param array $info
|
||||
* @return array|null
|
||||
*/
|
||||
public function resolve($val, $args, $context, $info)
|
||||
public function resolve( mixed $val, array $args, array $context, array $info ) : ?array
|
||||
{
|
||||
if( !\IPS\Member::loggedIn()->member_id || \IPS\Member::loggedIn()->members_disable_pm )
|
||||
if( !Member::loggedIn()->member_id || Member::loggedIn()->members_disable_pm )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user