-
Notifications
You must be signed in to change notification settings - Fork 15
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
ApolloError: Internal server error when querying "dropCap" attribute on core/paragraph block #238
Comments
Hey @jan-clockworkwp thank you for the report. Could you provide me with the saved database post content so I could try to reproduce as well?
|
Hi @theodesp, sure! Here is the post content from the database:
To give you a bit more background on why I am facing this issue, well, I am working on Faustjs with TypeScript. Because |
Hey @jan-clockworkwp. That is strange. I still can't reproduce with a plain paragraph. I can resolve the dropCap fields fine in WordPress 6.5. I see that the "dropCap" attribute for the CoreParagraph has a default value so this should not fail:
|
Hey @theodesp, thanks for getting back to me. Hmm, pretty strange. From what I can see in the schema, Additionally, I have looked into whether an attribute marked as required in the schema could be causing a problem. I was able to replicate the issue with the "errors": [
{
"debugMessage": "Undefined array key \"dropCap\"",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 20,
"column": 7
}
],
"path": [
"page",
"editorBlocks",
0,
"attributes",
"dropCap"
]
},
{
"debugMessage": "Undefined array key \"isLink\"",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 29,
"column": 7
}
],
"path": [
"page",
"editorBlocks",
2,
"attributes",
"isLink"
]
}
], |
Yes, if the field has a default value, then we register it as The code that deals with this logic is here: wp-graphql-content-blocks/includes/Blocks/Block.php Lines 175 to 181 in 8d4ab6c
However when the resolved field is not present, it should fall back to its default value which is taken from their field config: wp-graphql-content-blocks/includes/Blocks/Block.php Lines 436 to 438 in 8d4ab6c
So Im not sure where the logic fails in that case |
As mentioned above, collectively that method needs to be using isset() or array_key_exists(), on both the |
Confirming that the #245 solves the issue with native WP blocks attributes like, for example, |
When I query core/paragraph block with full list of attributes, I am getting the following FE error:
and GraphQL error:
In the Wp Admin GraphQL IDE,
dropCaps
attributed is in the list of available attributes.Seems like the issue is only with the attribute
dropCap
. When it is not in the query, all works as expected. This behaviour is on:Additional relevant plugins and packages used on FE:
Additional relevant plugins and packages used on BE:
Any idea what is going on? Could #182 be relevant to this issue?
The text was updated successfully, but these errors were encountered: