-
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]: GraphQL mutation "Author Id cannot be blank." #11312
Comments
The issue is most likely that you are trying to return the resulting entry’s |
Nope, I had to create a custom plugin to set an Everything with retrieving data works fine (including |
Sorry, looked into it again using an external GraphQL IDE and was able to reproduce. Fixed now for the next release! |
Thanks a ton for fixing this so quickly, Is there an ETA for this next release? |
Should be imminent. |
Craft 4.0.4 is out now with that fix. |
What happened?
Description
I created a very basic entry named
posts
. The type of the entry ischannel
and it only has one basic field namedtitle
.With GrapQL I am trying to insert a single post entry. When I do this outside craft (for example with postman) I get the error message
Author Id cannot be blank.
.This is the query what I'm trying to execute. User
21
exists in the database.I checked also the following in my Public schema:
I also tried with a private schema and a Bearer token and then my error message is
Cannot query field \"authorId\" on type \"posts_default_Entry\".
However, when I'm doing the exact same query in the
GraphQL Explorer
inside craft, I am able to create a post. Only theauthorId
is not set to the expected21 (normal user)
. But to my current session user1 (admin user)
.Query:
Result:
And in the docs it's written that I am able to send
authorId
as parameter.Steps to reproduce
Posts
, handle:posts
, Section type:channel
, Now the section has a Default entry type and a default fieldtitle
.GraphQL -> Schemas -> Plublic Schema -> Choose the available mutations for this schema
, check everything related toSection - posts
config/routes.php
add:'api' => 'graphql/api',
{yourSite}/api
Expected behavior
A post is created with that
authorId
Actual behavior
Error message:
Author Id cannot be blank.
orCannot query field \"authorId\" on type \"posts_default_Entry\".
Craft CMS version
4.0.3
PHP version
8.0.19
Operating system and version
Darwin 20.1.0
Database type and version
MySQL 8.0.29
Image driver and version
GD 8.0.19
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered: