-
Notifications
You must be signed in to change notification settings - Fork 5
Fix: Back-port compatibility fixes for wp-graphql-content-blocks to SnapWP Helper plugin #28
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
Conversation
…ers from model-compat branches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the backport looks good.
Fix the comments, fill out the PR description and this should be ready.
| */ | ||
| public function register_hooks(): void { | ||
| // No need to check for dependencies, since missing filters will just be ignored. | ||
| add_filter( 'wpgraphql_content_blocks_handle_do_block', [ ContentBlocksResolver::class, 'handle_do_block' ], 10, 1 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why we're not getting the inner blocks - you got rid of the graphql_object_fields filter which let us overload the entire class, and instead are only overloading the internal handle_do_block().
Revert this and your PR should be working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Donew ✅
| * @return array<string,mixed> The list of content blocks. | ||
| */ | ||
| public static function resolve_content_blocks( $node, $args, $allowed_block_names = [] ): array { | ||
| global $post_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this it's unused and removed in v4.2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed 🚀






What
In this PR, I backported specific compatibility fixes from
wp-graphql-content-blockstosnapwp-helperto resolve issues noted in issue #224. The main updates include adjustments to theContentBlocksResolver.phpand theSchemaFilters.phpfile.Why
This change is necessary because
snapwp-helperwas getting incompatible withWPGraphQL Content Blocks 4.2.0. This incompatibility was causing issues. Backporting these changes allowssnapwp-helperto remain compatible with WPGraphQL Content Blocks plugin.Related Issue(s):
Closes https://github.com/rtCamp/headless/issues/231
How
src/Modules/GraphQL/Data/ContentBlocksResolver.phpsrc/Modules/GraphQL/SchemaFilter.phpwp-graphql-content-blocksintosnapwp-helper.Testing Instructions
Screenshots
Checklist