Skip to content

Commit

Permalink
Fix #908
Browse files Browse the repository at this point in the history
  • Loading branch information
ttempleton committed Jul 25, 2024
1 parent b3cab72 commit b712e95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

### Fixed
- Fixed a bug where edited descendants of unedited blocks weren't being returned in GraphQL draft queries

## 4.2.8 - 2024-07-10

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/gql/types/elements/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function resolve(mixed $source, array $arguments, mixed $context, Reso

// The blocks at `$source->$fieldName` cannot be trusted, it will most likely be out of order and cached.
// We should retrieve the children blocks by query instead, so it'll always be in the correct order.
$descendants = $source->getDescendants()->all();
$descendants = $source->getDescendants()->ownerId($source->ownerId)->all();
$children = array_filter($descendants, function($block) use ($childrenLevel) {
return (int)$block->level === $childrenLevel;
});
Expand Down

0 comments on commit b712e95

Please sign in to comment.