From 97c54aeaacdb56502abe9d0712c2b1dca2af0c9b Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 22 Jul 2025 09:31:09 +0530 Subject: [PATCH] fix: add wildcards on `getDocument` response model as well. --- src/Appwrite/Utopia/Request/Filters/V20.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Utopia/Request/Filters/V20.php b/src/Appwrite/Utopia/Request/Filters/V20.php index 8719cf7325..bb25f39c8e 100644 --- a/src/Appwrite/Utopia/Request/Filters/V20.php +++ b/src/Appwrite/Utopia/Request/Filters/V20.php @@ -16,7 +16,7 @@ class V20 extends Filter switch ($model) { case 'databases.getDocument': case 'databases.listDocuments': - $content = $this->manageSelectQueries($content, $model); + $content = $this->manageSelectQueries($content); break; } return $content; @@ -30,7 +30,7 @@ class V20 extends Filter * This filter preserves 1.7.x behavior by including all related documents for backward compatibility with * `listDocuments` and `getDocument` calls. */ - protected function manageSelectQueries(array $content, string $model): array + protected function manageSelectQueries(array $content): array { $hasWildcard = false; if (! isset($content['queries'])) { @@ -58,7 +58,10 @@ class V20 extends Filter } } - if ($hasWildcard && $model === 'databases.listDocuments') { + /** + * Add `keys.*` for all model types! + */ + if ($hasWildcard) { $relatedKeys = $this->getRelatedCollectionKeys(); if (! empty($relatedKeys)) {