Skip to content

Commit

Permalink
Add in a check to make sure we're getting the next level blocks only.
Browse files Browse the repository at this point in the history
  • Loading branch information
pvldigital committed Sep 23, 2019
1 parent 37605ca commit e655869
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gql/types/elements/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ protected function resolve($source, $arguments, $context, ResolveInfo $resolveIn
$children = $source->getDescendants()->level($sourceLevel)->all();

if(count($children) and is_array($children)) {
$newBlocks = $children;

foreach ($children as $block) {
if ((int)$block->level === $sourceLevel) {
$newBlocks[] = $block;
}
}
// $newBlocks = $children;
}
}

Expand Down

0 comments on commit e655869

Please sign in to comment.