-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.x]: Can't alias GraphQL entries field to "author" (internal server error) #14057
Comments
When searching for similar issues I came across this comment from Brandon:
Seems relevant. |
Entries already have |
Aliases don't override anything. I don't see why there should be any conflict here as far as Craft is concerned. If I wanted the native author field in addition I could ask for |
The problem is that Craft automatically eager-loads any relation fields that are queried in GraphQL, using the same system used to eager-load native properties like I was able to fix this for Craft 5, by passing the actual eager-load plan to That’s a breaking change though, so there’s no way we can fix it for Craft 4.x. |
OK, thanks. So would there also be an issue if someone aliased the Craft |
Correct, because this condition would fail: Line 619 in ed7939d
That will also be resolved by the Craft 5 change, though. |
Craft 5.0.0-alpha.4 is out with that fix. |
What happened?
Description
I'm getting an internal server error when I attempt to alias an entries field to the identifier
author
.Steps to reproduce
authors
. Fields don't matter.recipes
authorEntry
) so the content author can choose anauthors
entry.authors
entry and arecipes
entry (mine has slugthe-last-word
), in which the author is selected.Expected behavior
Getting the author entry's title back, looking something like
Actual behavior
Notes:
author
field?Also:
Craft CMS version
4.5.11.1
PHP version
8.2.7
Operating system and version
Not sure exactly other than that it's linux, but it's running in a docker container based on
php:8.2-fpm
Database type and version
Postgres 14
Image driver and version
Imagick
Installed plugins and versions
The text was updated successfully, but these errors were encountered: