mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-25 14:26:08 +03:00
Failing test for CoroutineExecutor removes associative array when using custom scalar producing JSON
This commit is contained in:
parent
f96bd2740d
commit
31d89acfae
@ -6,6 +6,7 @@ namespace GraphQL\Tests\Executor;
|
|||||||
|
|
||||||
use GraphQL\Executor\Executor;
|
use GraphQL\Executor\Executor;
|
||||||
use GraphQL\Language\Parser;
|
use GraphQL\Language\Parser;
|
||||||
|
use GraphQL\Type\Definition\CustomScalarType;
|
||||||
use GraphQL\Type\Definition\ObjectType;
|
use GraphQL\Type\Definition\ObjectType;
|
||||||
use GraphQL\Type\Definition\Type;
|
use GraphQL\Type\Definition\Type;
|
||||||
use GraphQL\Type\Schema;
|
use GraphQL\Type\Schema;
|
||||||
@ -20,6 +21,13 @@ class ExecutorSchemaTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testExecutesUsingASchema() : void
|
public function testExecutesUsingASchema() : void
|
||||||
{
|
{
|
||||||
|
$BlogSerializableValueType = new CustomScalarType([
|
||||||
|
'name' => 'JsonSerializableValueScalar',
|
||||||
|
'serialize' => static function ($value) { return $value; },
|
||||||
|
'parseValue' => static function ($value) { return $value; },
|
||||||
|
'parseLiteral' => static function ($value) { return $value; },
|
||||||
|
]);
|
||||||
|
|
||||||
$BlogArticle = null;
|
$BlogArticle = null;
|
||||||
$BlogImage = new ObjectType([
|
$BlogImage = new ObjectType([
|
||||||
'name' => 'Image',
|
'name' => 'Image',
|
||||||
@ -57,6 +65,7 @@ class ExecutorSchemaTest extends TestCase
|
|||||||
'title' => ['type' => Type::string()],
|
'title' => ['type' => Type::string()],
|
||||||
'body' => ['type' => Type::string()],
|
'body' => ['type' => Type::string()],
|
||||||
'keywords' => ['type' => Type::listOf(Type::string())],
|
'keywords' => ['type' => Type::listOf(Type::string())],
|
||||||
|
'meta' => ['type' => $BlogSerializableValueType],
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -113,6 +122,7 @@ class ExecutorSchemaTest extends TestCase
|
|||||||
keywords
|
keywords
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
meta
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,6 +201,9 @@ class ExecutorSchemaTest extends TestCase
|
|||||||
'keywords' => ['foo', 'bar', '1', 'true', null],
|
'keywords' => ['foo', 'bar', '1', 'true', null],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'meta' => [
|
||||||
|
'title' => 'My Article 1 | My Blog'
|
||||||
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
@ -210,6 +223,9 @@ class ExecutorSchemaTest extends TestCase
|
|||||||
'body' => 'This is a post',
|
'body' => 'This is a post',
|
||||||
'hidden' => 'This data is not exposed in the schema',
|
'hidden' => 'This data is not exposed in the schema',
|
||||||
'keywords' => ['foo', 'bar', 1, true, null],
|
'keywords' => ['foo', 'bar', 1, true, null],
|
||||||
|
'meta' => [
|
||||||
|
'title' => 'My Article 1 | My Blog',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user