Skip to content

Commit

Permalink
Fix error clientMutationId is removed when equal to 0 and access is…
Browse files Browse the repository at this point in the history
… used...
  • Loading branch information
mcg-web committed Apr 7, 2016
1 parent 8659ab8 commit 2e2b860
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 6 additions & 8 deletions Resolver/Config/FieldsConfigSolution.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,12 @@ private function filterResultUsingAccess($result, $expression, $values)
$checkAccess = $this->checkAccessCallback($expression, $values);

switch (true) {
case is_array($result) || $result instanceof \ArrayAccess:
$result = array_filter(
array_map(
function ($object) use ($checkAccess) {
return $checkAccess($object) ? $object : null;
},
$result
)
case is_array($result):
$result = array_map(
function ($object) use ($checkAccess) {
return $checkAccess($object) ? $object : null;
},
$result
);
break;

Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Security/AccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private function expectedFailedUserRoles()
return [
'data' => [
'user' => [
'roles' => [],
'roles' => [0 => null],
],
],
];
Expand Down
2 changes: 2 additions & 0 deletions Tests/Resolver/Config/FieldsConfigSolutionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public function testResolveAccessAndWrapResolveCallbackWithArrayAndAccessDeniedT
'tata',
'titi',
'tata',
null,
null,
],
$callback(
[
Expand Down

0 comments on commit 2e2b860

Please sign in to comment.