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,26 +10,29 @@
|
||||
*/
|
||||
|
||||
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\LoginType;
|
||||
use IPS\Login;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Login handler query for GraphQL API
|
||||
*/
|
||||
class _LoginHandlers
|
||||
class LoginHandlers
|
||||
{
|
||||
|
||||
/*
|
||||
* @brief Query description
|
||||
*/
|
||||
public static $description = "Return login handler data";
|
||||
public static string $description = "Return login handler data";
|
||||
|
||||
/*
|
||||
* Query arguments
|
||||
@@ -43,8 +46,10 @@ class _LoginHandlers
|
||||
|
||||
/**
|
||||
* Return the query return type
|
||||
*
|
||||
* @return ListOfType<LoginType>
|
||||
*/
|
||||
public function type()
|
||||
public function type() : ListOfType
|
||||
{
|
||||
return TypeRegistry::listOf( \IPS\core\api\GraphQL\TypeRegistry::login() );
|
||||
}
|
||||
@@ -52,14 +57,13 @@ class _LoginHandlers
|
||||
/**
|
||||
* Resolves this query
|
||||
*
|
||||
* @param mixed Value passed into this resolver
|
||||
* @param array Arguments
|
||||
* @param array Context values
|
||||
* @return \IPS\Member|null
|
||||
* @param mixed $val Value passed into this resolver
|
||||
* @param array $args Arguments
|
||||
* @return array
|
||||
*/
|
||||
public function resolve($val, $args)
|
||||
public function resolve( mixed $val, array $args ) : array
|
||||
{
|
||||
$login = new \IPS\Login;
|
||||
$login = new Login;
|
||||
return $login->buttonMethods();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user