Skip to content

Conversation

jasonbahl
Copy link
Contributor

@jasonbahl jasonbahl commented Aug 30, 2023

What does this implement/fix? Explain your changes.

Adds support for ACF Blocks + WPGraphQL Content Blocks.

In addition, this resolves some issues with clone fields and how their interfaces are (or are not) applied to other field groups that clone them.

@todo:

Any other comments?

With WPGraphQL Content Blocks, we can query Editor Blocks.

With this PR, we can now query ACF Field Groups and Fields associated with ACF Blocks.

Ex:

CleanShot 2023-08-30 at 15 43 04

And:

CleanShot 2023-08-30 at 15 44 58

- correct issues reported by phpstan after inclusion of acf stubs
- register interface type AcfBlock
- add third party support & filter to for working with WPGraphQL Content Blocks
- update get_node_acf_id
- register blocks to the schema in WPGraphQLAcf.php
- add support for block rules in LocationRules.php
…olve cloned fields

- phpcs updates
- change Registry->get_connection_name to only accept the ToType and return a simplified Connection name to help prevent duplicate connections from being registered (breaking as the public function signature changed)
- move the AcfBlock Interface into the WPGraphQLContentBlocks.php file
- only apply interfaces for cloned field groups if ALL fields of the cloned field group have been cloned
- introduce `wpgraphql/acf/get_all_possible_types/interfaces` filter
- phpstan updates
- update tests to reflect change to Registry->get_connection_name()
…tent-blocks-support

# Conflicts:
#	composer.lock
#	src/assets/admin/js/main.js
@coveralls
Copy link

Pull Request Test Coverage Report for Build 92a879717b1193468ed70f0c5b27bc789888d59f-PR-81

  • 38 of 115 (33.04%) changed or added relevant lines in 11 files are covered.
  • 21 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-1.4%) to 55.486%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Utils.php 0 1 0.0%
src/ThirdParty.php 0 2 0.0%
src/Admin/Settings.php 0 4 0.0%
src/FieldConfig.php 13 20 65.0%
src/Registry.php 18 33 54.55%
src/ThirdParty/WPGraphQLContentBlocks/WPGraphQLContentBlocks.php 0 23 0.0%
src/LocationRules/LocationRules.php 0 25 0.0%
Files with Coverage Reduction New Missed Lines %
src/LocationRules/LocationRules.php 1 45.21%
src/Utils.php 2 48.41%
src/Admin/PostTypeRegistration.php 4 0.0%
src/Admin/TaxonomyRegistration.php 4 0.0%
src/Admin/Settings.php 10 0.0%
Totals Coverage Status
Change from base Build 873d1bebc5cc4a82d71df9b4877828ae80e38471: -1.4%
Covered Lines: 1502
Relevant Lines: 2707

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants