Version 4.7.8
This commit is contained in:
1 parent
7b7404e741
commit
fd22d99e69
688 files changed
+19814
-10890
No files matched your search
@@ -32,7 +32,7 @@ abstract class _AppQueries
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function queries($app)
|
||||
public static function queries($app): array
|
||||
{
|
||||
return [
|
||||
'moduleAccess' => new \IPS\Api\GraphQL\Queries\ModuleAccess($app)
|
||||
|
||||
@@ -30,7 +30,7 @@ abstract class _CoverPhotoField
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getDefinition($name)
|
||||
public static function getDefinition($name): array
|
||||
{
|
||||
return [
|
||||
'type' => new ObjectType([
|
||||
|
||||
@@ -30,7 +30,7 @@ abstract class _TagsEditField
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getDefinition($name)
|
||||
public static function getDefinition($name): array
|
||||
{
|
||||
return [
|
||||
'type' => new ObjectType([
|
||||
|
||||
@@ -33,10 +33,12 @@ class _GraphQL
|
||||
*
|
||||
* @param string $query The query to execute
|
||||
* @param array $variables Variables to include in query
|
||||
* @param \IPS\Member|NULL $member Member to check or NULL for currently logged in member.
|
||||
* @return array GraphQL response
|
||||
*/
|
||||
public static function execute( string $query, array $variables = [], array $member = NULL )
|
||||
public static function execute( string $query, array $variables = [], ?\IPS\Member $member = NULL )
|
||||
{
|
||||
$member = $member ?: \IPS\Member::loggedIn();
|
||||
/* Register our GraphQL library */
|
||||
\IPS\IPS::$PSR0Namespaces['GraphQL'] = \IPS\ROOT_PATH . "/system/3rd_party/graphql-php";
|
||||
|
||||
@@ -49,7 +51,7 @@ class _GraphQL
|
||||
$query,
|
||||
NULL, // $rootValue
|
||||
[
|
||||
'member' => \IPS\Member::loggedIn()
|
||||
'member' => $member
|
||||
], // $context
|
||||
$variables
|
||||
);
|
||||
|
||||
@@ -38,8 +38,9 @@ class _ModuleAccess
|
||||
/*
|
||||
* Query arguments
|
||||
*/
|
||||
public function args()
|
||||
public function args(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,7 +57,7 @@ class _ModuleAccess
|
||||
* @param mixed Value passed into this resolver
|
||||
* @param array Arguments
|
||||
* @param array Context values
|
||||
* @return \IPS\core\Stream
|
||||
* @return \IPS\Application
|
||||
*/
|
||||
public function resolve($val, $args, $context)
|
||||
{
|
||||
|
||||
@@ -47,25 +47,25 @@ class _TypeRegistry
|
||||
}
|
||||
|
||||
/**
|
||||
* @return QueryType
|
||||
* @return \IPS\Api\GraphQL\Types\QueryType
|
||||
*/
|
||||
public static function query()
|
||||
public static function query(): \IPS\Api\GraphQL\Types\QueryType
|
||||
{
|
||||
return self::$query ?: (self::$query = new \IPS\Api\GraphQL\Types\QueryType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MutationType
|
||||
* @return \IPS\Api\GraphQL\Types\MutationType
|
||||
*/
|
||||
public static function mutation()
|
||||
public static function mutation(): \IPS\Api\GraphQL\Types\MutationType
|
||||
{
|
||||
return self::$mutation ?: (self::$mutation = new \IPS\Api\GraphQL\Types\MutationType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ItemStateType
|
||||
* @return \IPS\Api\GraphQL\Types\ItemStateType
|
||||
*/
|
||||
public static function itemState()
|
||||
public static function itemState(): \IPS\Api\GraphQL\Types\ItemStateType
|
||||
{
|
||||
return self::$itemState ?: (self::$itemState = new \IPS\Api\GraphQL\Types\ItemStateType());
|
||||
}
|
||||
@@ -73,47 +73,47 @@ class _TypeRegistry
|
||||
/**
|
||||
* @return ImageType
|
||||
*/
|
||||
public static function image()
|
||||
public static function image(): \IPS\Api\GraphQL\Types\ImageType
|
||||
{
|
||||
return self::$image ?: (self::$image = new \IPS\Api\GraphQL\Types\ImageType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ReputationType
|
||||
* @return \IPS\Api\GraphQL\Types\ReputationType
|
||||
*/
|
||||
public static function reputation()
|
||||
public static function reputation(): \IPS\Api\GraphQL\Types\ReputationType
|
||||
{
|
||||
return self::$reputation ?: (self::$reputation = new \IPS\Api\GraphQL\Types\ReputationType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RichTextType
|
||||
* @return \IPS\Api\GraphQL\Types\RichTextType
|
||||
*/
|
||||
public static function richText()
|
||||
public static function richText(): \IPS\Api\GraphQL\Types\RichTextType
|
||||
{
|
||||
return self::$richText ?: (self::$richText = new \IPS\Api\GraphQL\Types\RichTextType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return URLType
|
||||
* @return \IPS\Api\GraphQL\Types\UrlType
|
||||
*/
|
||||
public static function url()
|
||||
public static function url(): \IPS\Api\GraphQL\Types\UrlType
|
||||
{
|
||||
return self::$url ?: (self::$url = new \IPS\Api\GraphQL\Types\UrlType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return FollowType
|
||||
* @return \IPS\Api\GraphQL\Types\FollowType
|
||||
*/
|
||||
public static function follow()
|
||||
public static function follow(): \IPS\Api\GraphQL\Types\FollowType
|
||||
{
|
||||
return self::$follow ?: (self::$follow = new \IPS\Api\GraphQL\Types\FollowType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ModuleAccessType
|
||||
* @return \IPS\Api\GraphQL\Types\ModuleAccessType
|
||||
*/
|
||||
public static function moduleAccess()
|
||||
public static function moduleAccess(): \IPS\Api\GraphQL\Types\ModuleAccessType
|
||||
{
|
||||
return self::$moduleAccess ?: (self::$moduleAccess = new \IPS\Api\GraphQL\Types\ModuleAccessType());
|
||||
}
|
||||
@@ -121,7 +121,7 @@ class _TypeRegistry
|
||||
/**
|
||||
* @return \GraphQL\Type\Definition\IDType
|
||||
*/
|
||||
public static function id()
|
||||
public static function id(): \GraphQL\Type\Definition\IDType
|
||||
{
|
||||
return Type::id();
|
||||
}
|
||||
@@ -129,7 +129,7 @@ class _TypeRegistry
|
||||
/**
|
||||
* @return \GraphQL\Type\Definition\StringType
|
||||
*/
|
||||
public static function string()
|
||||
public static function string(): \GraphQL\Type\Definition\StringType
|
||||
{
|
||||
return Type::string();
|
||||
}
|
||||
@@ -137,7 +137,7 @@ class _TypeRegistry
|
||||
/**
|
||||
* @return \GraphQL\Type\Definition\IntType
|
||||
*/
|
||||
public static function int()
|
||||
public static function int(): \GraphQL\Type\Definition\IntType
|
||||
{
|
||||
return Type::int();
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class _TypeRegistry
|
||||
/**
|
||||
* @return \GraphQL\Type\Definition\FloatType
|
||||
*/
|
||||
public static function float()
|
||||
public static function float(): \GraphQL\Type\Definition\FloatType
|
||||
{
|
||||
return Type::float();
|
||||
}
|
||||
@@ -153,7 +153,7 @@ class _TypeRegistry
|
||||
/**
|
||||
* @return \GraphQL\Type\Definition\BooleanType
|
||||
*/
|
||||
public static function boolean()
|
||||
public static function boolean(): \GraphQL\Type\Definition\BooleanType
|
||||
{
|
||||
return Type::boolean();
|
||||
}
|
||||
@@ -161,7 +161,7 @@ class _TypeRegistry
|
||||
/**
|
||||
* @return \GraphQL\Type\Definition\ListOfType
|
||||
*/
|
||||
public static function listOf($type)
|
||||
public static function listOf($type): \GraphQL\Type\Definition\ListOfType
|
||||
{
|
||||
return new ListOfType($type);
|
||||
}
|
||||
@@ -169,12 +169,12 @@ class _TypeRegistry
|
||||
/**
|
||||
* @return \GraphQL\Type\Definition\EnumType
|
||||
*/
|
||||
public static function eNum($config)
|
||||
public static function eNum($config): \GraphQL\Type\Definition\EnumType
|
||||
{
|
||||
return new EnumType($config);
|
||||
}
|
||||
|
||||
public static function inputObjectType($config)
|
||||
public static function inputObjectType($config): \GraphQL\Type\Definition\InputObjectType
|
||||
{
|
||||
return new InputObjectType($config);
|
||||
}
|
||||
@@ -183,7 +183,7 @@ class _TypeRegistry
|
||||
* @param Type $type
|
||||
* @return NonNull
|
||||
*/
|
||||
public static function nonNull($type)
|
||||
public static function nonNull($type): \GraphQL\Type\Definition\NonNull
|
||||
{
|
||||
return new NonNull($type);
|
||||
}
|
||||
|
||||
@@ -84,13 +84,10 @@ class _MutationType extends ObjectType
|
||||
}
|
||||
|
||||
return $mutationResolvers;
|
||||
|
||||
$mutationClass = new $className;
|
||||
return $mutationClass->resolve($val, $args, $context, $info);
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_RESOLVE', '3S291/2', 405 );
|
||||
throw new \IPS\Api\Exception( 'NO_RESOLVE', '3S291/2_graphl', 405 );
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user