File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ function execute(
231231 $ validations = GraphQL::getStandardValidationRules ();
232232
233233 if (System::getEnv ('_APP_GRAPHQL_INTROSPECTION ' , 'enabled ' ) === 'disabled ' ) {
234- $ validations [] = new DisableIntrospection ();
234+ $ validations [] = new DisableIntrospection (DisableIntrospection:: ENABLED );
235235 }
236236
237237 if (System::getEnv ('_APP_OPTIONS_ABUSE ' , 'enabled ' ) !== 'disabled ' ) {
Original file line number Diff line number Diff line change 9292 "chillerlan/php-qrcode" : " 4.3.*" ,
9393 "adhocore/jwt" : " 1.1.*" ,
9494 "spomky-labs/otphp" : " 11.*" ,
95- "webonyx/graphql-php" : " 14.11 .*" ,
95+ "webonyx/graphql-php" : " 15.31 .*" ,
9696 "league/csv" : " 9.14.*" ,
9797 "enshrined/svg-sanitize" : " 0.22.*"
9898 },
Original file line number Diff line number Diff line change @@ -81,8 +81,8 @@ abstract public function createRejected(mixed $reason): GQLPromise;
8181 /**
8282 * Create a new promise that resolves when all passed in promises resolve.
8383 *
84- * @param array $promisesOrValues
84+ * @param iterable $promisesOrValues
8585 * @return GQLPromise
8686 */
87- abstract public function all (array $ promisesOrValues ): GQLPromise ;
87+ abstract public function all (iterable $ promisesOrValues ): GQLPromise ;
8888}
Original file line number Diff line number Diff line change @@ -35,8 +35,12 @@ public function createRejected($reason): GQLPromise
3535 return new GQLPromise ($ promise , $ this );
3636 }
3737
38- public function all (array $ promisesOrValues ): GQLPromise
38+ public function all (iterable $ promisesOrValues ): GQLPromise
3939 {
40+ if ($ promisesOrValues instanceof \Traversable) {
41+ $ promisesOrValues = \iterator_to_array ($ promisesOrValues );
42+ }
43+
4044 return new GQLPromise (SwoolePromise::all ($ promisesOrValues ), $ this );
4145 }
4246}
Original file line number Diff line number Diff line change 33namespace Appwrite \GraphQL \Types ;
44
55use GraphQL \Language \AST \Node ;
6+ use GraphQL \Language \AST \StringValueNode ;
67
78// https://github.com/webonyx/graphql-php/issues/129#issuecomment-309366803
89class Assoc extends Json
910{
10- public $ name = 'Assoc ' ;
11- public $ description = 'The `Assoc` scalar type represents associative array values. ' ;
11+ public string $ name = 'Assoc ' ;
12+ public ? string $ description = 'The `Assoc` scalar type represents associative array values. ' ;
1213
1314 public function serialize ($ value )
1415 {
@@ -30,6 +31,10 @@ public function parseValue($value)
3031
3132 public function parseLiteral (Node $ valueNode , ?array $ variables = null )
3233 {
33- return \json_decode ($ valueNode ->value , true );
34+ if ($ valueNode instanceof StringValueNode) {
35+ return \json_decode ($ valueNode ->value , true );
36+ }
37+
38+ return parent ::parseLiteral ($ valueNode , $ variables );
3439 }
3540}
Original file line number Diff line number Diff line change 88
99class InputFile extends ScalarType
1010{
11- public $ name = 'InputFile ' ;
12- public $ description = 'The `InputFile` special type represents a file to be uploaded in the same HTTP request as specified by
11+ public string $ name = 'InputFile ' ;
12+ public ? string $ description = 'The `InputFile` special type represents a file to be uploaded in the same HTTP request as specified by
1313 [graphql-multipart-request-spec](https://github.com/jaydenseric/graphql-multipart-request-spec). ' ;
1414
1515 public function serialize ($ value )
Original file line number Diff line number Diff line change 1414// https://github.com/webonyx/graphql-php/issues/129#issuecomment-309366803
1515class Json extends ScalarType
1616{
17- public $ name = 'Json ' ;
18- public $ description = 'The `JSON` scalar type represents JSON values as specified by
17+ public string $ name = 'Json ' ;
18+ public ? string $ description = 'The `JSON` scalar type represents JSON values as specified by
1919 [ECMA-404](https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). ' ;
2020
2121 public function serialize ($ value )
Original file line number Diff line number Diff line change 44
55use Appwrite \GraphQL \Types \Mapper ;
66use Appwrite \Utopia \Response ;
7+ use GraphQL \Type \Definition \NamedType ;
78use PHPUnit \Framework \TestCase ;
89use Swoole \Http \Response as SwooleResponse ;
910
@@ -24,6 +25,7 @@ public function testCreateTypeMapping()
2425 {
2526 $ model = $ this ->response ->getModel (Response::MODEL_TABLE );
2627 $ type = Mapper::model (\ucfirst ($ model ->getType ()));
27- $ this ->assertEquals ('Table ' , $ type ->name );
28+ $ this ->assertInstanceOf (NamedType::class, $ type );
29+ $ this ->assertEquals ('Table ' , $ type ->name ());
2830 }
2931}
You can’t perform that action at this time.
0 commit comments