What happened?
Description
Entry is missing after moving it to a new parent and querying descendants for it's new parent with graphql, eg. with
query GetChildEntries($elementId: QueryArgument) {
entry(id: [$elementId]) {
descendants {
title
}
}
}
I tried to replicate the issue with PHP queries eg. Entry::find()->descendantOf(1234)->select('title')->column() but that worked as expected, so it does seem to be isolated to graphql.
If you clear the GraphQL cache under Utilities > Caches > Invalidate Data Caches > GraphQL queries, it does then return the correct response.
This issue only happens when moving an entry under a parent, not moving it from the parent.
Steps to reproduce
-
Set up an entry structure like this

-
Query the descendents of the parent using the parent's ID
curl -X POST \
-H "content-type: application/json" \
-H "authorization: Bearer TOKEN_HERE" \
--data '{"query":"query GetChildEntries($elementId: QueryArgument) {\n entry(id: [$elementId]) {\n descendants {\n title\n }\n }\n}","variables":{"elementId":ID_HERE},"operationName":"GetChildEntries"}' \
DOMAIN_HERE/index.php/CP_TRIGGER_HERE/actions/graphql/api
-
Get the expected result:
{"data":{"entry":{"descendants":[{"title":"Beauty & Fashion"},{"title":"Leisure & Hospitality"},{"title":"Breweries & Beverages"}]}}}
-
Move another entry under the same parent

-
Query again with the same curl request
Expected behavior
You should get
{"data":{"entry":{"descendants":[{"title":"Beauty & Fashion"},{"title":"Leisure & Hospitality"},{"title":"Breweries & Beverages"},{"title":"Automotive"}]}}}
Actual behavior
You actually get the same result as before
{"data":{"entry":{"descendants":[{"title":"Beauty & Fashion"},{"title":"Leisure & Hospitality"},{"title":"Breweries & Beverages"},{"title":"Automotive"}]}}}
Craft CMS version
4.8.9
PHP version
8.2
Operating system and version
ddev version v1.22.6
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
- Batch Actions - 1.3.1
- Block Usage - 1.0.2
- CKEditor - 3.8.3
- CP Field Inspect - 1.4.4
- Expanded Singles - 2.0.5
- Feed Me - 5.4.0
- Formie - 2.1.12
- Image Resizer - 3.0.11
- Inventory - 3.2.0
- Logs - 4.0.0
- Navigation - 2.0.27
- Neo - 4.1.2
- Phone Number - 2.2.0
- Retour - 4.1.16
- Scout - 4.0.0
- SEOmatic - 4.0.48
- Servd Assets and Helpers - 3.5.12
- Tags - 2.0.0
- Typed link field - 2.1.5
What happened?
Description
Entry is missing after moving it to a new parent and querying descendants for it's new parent with graphql, eg. with
I tried to replicate the issue with PHP queries eg.
Entry::find()->descendantOf(1234)->select('title')->column()but that worked as expected, so it does seem to be isolated to graphql.If you clear the GraphQL cache under Utilities > Caches > Invalidate Data Caches > GraphQL queries, it does then return the correct response.
This issue only happens when moving an entry under a parent, not moving it from the parent.
Steps to reproduce
Set up an entry structure like this

Query the descendents of the parent using the parent's ID
Get the expected result:
{"data":{"entry":{"descendants":[{"title":"Beauty & Fashion"},{"title":"Leisure & Hospitality"},{"title":"Breweries & Beverages"}]}}}Move another entry under the same parent

Query again with the same curl request
Expected behavior
You should get
{"data":{"entry":{"descendants":[{"title":"Beauty & Fashion"},{"title":"Leisure & Hospitality"},{"title":"Breweries & Beverages"},{"title":"Automotive"}]}}}Actual behavior
You actually get the same result as before
{"data":{"entry":{"descendants":[{"title":"Beauty & Fashion"},{"title":"Leisure & Hospitality"},{"title":"Breweries & Beverages"},{"title":"Automotive"}]}}}Craft CMS version
4.8.9
PHP version
8.2
Operating system and version
ddev version v1.22.6
Database type and version
No response
Image driver and version
No response
Installed plugins and versions