-
Notifications
You must be signed in to change notification settings - Fork 14
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
Latest version of Wordpress 6.5.4 returns null for various core block attributes #242
Comments
Hello @rudiwebworx are you using the latest version of this plugin? I have a similar setup but I cannot reproduce this issue. |
Hi 👋 — We're also running into this upon updating from This broke all pages where these fields were queried and forced us to roll back and defer updates. Our environment, arrows indicating the updated environment we tried that resulted in an outage:
Essential fields like I tried updating plugins and the system first—no-go. Then tried just updating the system—also a no-go. That's why I suspected the issue being that Gutenberg blocks have changed but that change isn't reflected in the content block plugin for GraphQL. |
@theodesp yes we are using the latest with the following:
Errors: In GraphQL IDE query e.g query PostBySlug {
pages(where: {id: 2}) {
nodes {
editorBlocks {
... on CoreParagraph {
anchor
apiVersion
attributes {
content
align
}
}
... on CoreButtons {
anchor
apiVersion
attributes {
align
cssClassName
className
style
}
}
... on CoreButton {
anchor
apiVersion
attributes {
title
type
url
}
}
}
title
slug
}
}
} returns null several times for align... e.g {
"anchor": null,
"apiVersion": 3,
"attributes": {
"content": "Beast Philanthropy is a 501(c)3 organization ....",
"align": null
}
}, Rolling back to WP 6.4.5 fixes this so assuming gutenberg has changed something which means this plugin needs some refactoring. Thanks in advance! |
Hey! I run with the same issue on my side with an ACF block when I try to get BlockCtaSmall.fragments = {
blocks: gql`
fragment BlockCtaFragment on EditorBlock {
... on AcfBlockCta {
anchor
fields: blockCta {
title
description
button {
url
title
target
}
}
}
}
`,
};
|
I think this is a separate issue, that I've been meaning to file too – but it's unclear to me whether the bug is in this repo or stemming from the graphql-acf plugin. I'd wager a guess that you are querying 'align' on all blocks, and the error is thrown only on the acf block.
finally you can rename 'alignment' back to 'align' in the endpoint that pulls the data. not pretty but it works. |
I ran into this as well. I believe this is an issue related to a change in WordPress core that is getting passed downstream. WPGraphQL Content Blocks reads the block registry and converts it into a GraphQL Schema. If a registration of a block is changed, it can lead to changes in the Schema, and I believe that is the case here. I want to look into it further, but I do believe it's related to a WordPress core update. |
Upon review -
Using determinate attribute types would both fix the type conflicts along with the possibility of an attribute getting removed/renamed from the This is being tangentially tracked in #136 (see this outdated list of type issues: #136 (comment) ) |
On the latest version of wordpress 6.5.4 getting the following errors
Seems that there have been some changes to gutenberg core blocks that require the refactoring of this plugin.
The text was updated successfully, but these errors were encountered: