-
Notifications
You must be signed in to change notification settings - Fork 468
Author field returns null on custom post type query even though CPT is registered with support => 'author' #1476
Copy link
Copy link
Closed
Labels
needs: author responseAdditional Pending information from the author has been requested from the authorAdditional Pending information from the author has been requested from the authortype: questionAn issue that involve inquiries, clarifications, or requests for guidanceAn issue that involve inquiries, clarifications, or requests for guidance
Description
Hi there,
I ran into an issue but im not sure whether it's me or something is wrong with the schema. I have registered a CPT with
$args = [
'show_in_graphql' => true,
'graphql_single_name' => 'someCpt',
'graphql_plural_name' => 'someCpts',
'graphql_single_type' => 'SomeCpt',
'graphql_plural_type' => 'SomeCpts',
'supports' => ['author', 'title', 'custom-fields']
];When I try to query the CPT including the author data I get NULL as response.
Query
query SomeCptQuery {
someCpts {
edges {
id
authorDatabaseId
author {
node {
firstName
lastName
}
}
}
}
}
Response
{
"data": {
"someCpts": {
"edges": [
"node": {
"id": "SOME_HASH"
"authorDatabaseId": 1
"author": null
}
]
}
}
}Did I do something wrong or is it simply not possible to do that?
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs: author responseAdditional Pending information from the author has been requested from the authorAdditional Pending information from the author has been requested from the authortype: questionAn issue that involve inquiries, clarifications, or requests for guidanceAn issue that involve inquiries, clarifications, or requests for guidance