mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-22 04:46:04 +03:00
And a few more in tests
This commit is contained in:
parent
19a37609f4
commit
c069d20ca7
@ -62,7 +62,7 @@ $mutationType = new ObjectType([
|
|||||||
'episode' => $episodeEnum,
|
'episode' => $episodeEnum,
|
||||||
'review' => $reviewInputObject
|
'review' => $reviewInputObject
|
||||||
],
|
],
|
||||||
'resolve' => function($val, $args) {
|
'resolve' => function($rootValue, $args) {
|
||||||
// TODOC
|
// TODOC
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -57,8 +57,8 @@ class QueryType extends ObjectType
|
|||||||
],
|
],
|
||||||
'hello' => Type::string()
|
'hello' => Type::string()
|
||||||
],
|
],
|
||||||
'resolveField' => function($val, $args, $context, ResolveInfo $info) {
|
'resolveField' => function($rootValue, $args, $context, ResolveInfo $info) {
|
||||||
return $this->{$info->fieldName}($val, $args, $context, $info);
|
return $this->{$info->fieldName}($rootValue, $args, $context, $info);
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
|
@ -185,7 +185,7 @@ class DeferredFieldsTest extends TestCase
|
|||||||
'fields' => [
|
'fields' => [
|
||||||
'topStories' => [
|
'topStories' => [
|
||||||
'type' => Type::listOf($this->storyType),
|
'type' => Type::listOf($this->storyType),
|
||||||
'resolve' => function ($val, $args, $context, ResolveInfo $info) {
|
'resolve' => function ($rootValue, $args, $context, ResolveInfo $info) {
|
||||||
$this->paths[] = $info->path;
|
$this->paths[] = $info->path;
|
||||||
|
|
||||||
return Utils::filter(
|
return Utils::filter(
|
||||||
@ -198,7 +198,7 @@ class DeferredFieldsTest extends TestCase
|
|||||||
],
|
],
|
||||||
'featuredCategory' => [
|
'featuredCategory' => [
|
||||||
'type' => $this->categoryType,
|
'type' => $this->categoryType,
|
||||||
'resolve' => function ($val, $args, $context, ResolveInfo $info) {
|
'resolve' => function ($rootValue, $args, $context, ResolveInfo $info) {
|
||||||
$this->paths[] = $info->path;
|
$this->paths[] = $info->path;
|
||||||
|
|
||||||
return $this->categoryDataSource[0];
|
return $this->categoryDataSource[0];
|
||||||
@ -206,7 +206,7 @@ class DeferredFieldsTest extends TestCase
|
|||||||
],
|
],
|
||||||
'categories' => [
|
'categories' => [
|
||||||
'type' => Type::listOf($this->categoryType),
|
'type' => Type::listOf($this->categoryType),
|
||||||
'resolve' => function ($val, $args, $context, ResolveInfo $info) {
|
'resolve' => function ($rootValue, $args, $context, ResolveInfo $info) {
|
||||||
$this->paths[] = $info->path;
|
$this->paths[] = $info->path;
|
||||||
|
|
||||||
return $this->categoryDataSource;
|
return $this->categoryDataSource;
|
||||||
@ -401,7 +401,7 @@ class DeferredFieldsTest extends TestCase
|
|||||||
return [
|
return [
|
||||||
'sync' => [
|
'sync' => [
|
||||||
'type' => Type::string(),
|
'type' => Type::string(),
|
||||||
'resolve' => function ($v, $a, $c, ResolveInfo $info) {
|
'resolve' => function ($rootValue, $a, $c, ResolveInfo $info) {
|
||||||
$this->paths[] = $info->path;
|
$this->paths[] = $info->path;
|
||||||
|
|
||||||
return 'sync';
|
return 'sync';
|
||||||
@ -409,7 +409,7 @@ class DeferredFieldsTest extends TestCase
|
|||||||
],
|
],
|
||||||
'deferred' => [
|
'deferred' => [
|
||||||
'type' => Type::string(),
|
'type' => Type::string(),
|
||||||
'resolve' => function ($v, $a, $c, ResolveInfo $info) {
|
'resolve' => function ($rootValue, $a, $c, ResolveInfo $info) {
|
||||||
$this->paths[] = $info->path;
|
$this->paths[] = $info->path;
|
||||||
|
|
||||||
return new Deferred(function () use ($info) {
|
return new Deferred(function () use ($info) {
|
||||||
@ -421,7 +421,7 @@ class DeferredFieldsTest extends TestCase
|
|||||||
],
|
],
|
||||||
'nest' => [
|
'nest' => [
|
||||||
'type' => $complexType,
|
'type' => $complexType,
|
||||||
'resolve' => function ($v, $a, $c, ResolveInfo $info) {
|
'resolve' => function ($rootValue, $a, $c, ResolveInfo $info) {
|
||||||
$this->paths[] = $info->path;
|
$this->paths[] = $info->path;
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
@ -429,7 +429,7 @@ class DeferredFieldsTest extends TestCase
|
|||||||
],
|
],
|
||||||
'deferredNest' => [
|
'deferredNest' => [
|
||||||
'type' => $complexType,
|
'type' => $complexType,
|
||||||
'resolve' => function ($v, $a, $c, ResolveInfo $info) {
|
'resolve' => function ($rootValue, $a, $c, ResolveInfo $info) {
|
||||||
$this->paths[] = $info->path;
|
$this->paths[] = $info->path;
|
||||||
|
|
||||||
return new Deferred(function () use ($info) {
|
return new Deferred(function () use ($info) {
|
||||||
|
Loading…
Reference in New Issue
Block a user