Skip to content

Clone fields not registered with the schema when individual field is selected #258

@juliecampbell

Description

@juliecampbell

Description

We are in the middle of upgrading from the v0.6 version of the plugin to the v2.0 version. We found a clone field that is currently correctly registering with the GraphQL schema in the v0.6 version was not registering when using the v2.0 version.

After a lot of investigating and narrowing down, we found that how the fields to be included in the clone are defined seems to affect whether or not the clone field is registered.

  1. If the selected fields are "All fields from {field group name} field group", then the clone field is registered and appears in the schema.
  2. If the selected fields are cherry-picked fields, then the clone field is not registered and does not appear in the schema. Nesting the clone field inside of a group field in this case does let it register.

We would expect that selecting specific fields for a clone field group would not cause the clone field to not be registered. All clones are Seamless and do not prefix field names (though we did test with prefixing field names to see if that would resolve the issue, and it did not).

Nesting clones and field name collisions were also investigated and ruled out as the source of the issue.

Steps to reproduce

See ACF field group export below for a structure that reproduces the issue.

PHP or JSON export of the ACF Field Group(s)

A simple ACF field structure that shows the issue is here: test_structure.zip

For simplicity's sake, this structure is made for Pages (we discovered this issue on a custom post type). Top Level Group is the the top level, and contains a text field and 2 clones. Middle Level Group and Bottom Level Group contain the fields being cloned.

The 2 fields being cloned should be SectionTitle (all fields from field group) and SectionLinks (cherry-picked field). The below screenshot is the available schema in the WP admin GraphQL IDE - SectionLinks is missing.

Image

Additional context

No response

WPGraphQL Version

1.32.1

WPGraphQL For ACF Version

2.4.1

ACF (Advanced Custom Fields) Version. Free or Pro?

6.3.12, Pro

WordPress Version

6.7.2

PHP Version

8.3

Additional enviornment details

wp-graphql-content-blocks: 4.2.0
sitepress-multilingual-cms (WPML): 4.7.3
wpml-graphql: 1.1.2
gravityforms: 2.9.5.2
wp-graphql-gravity-forms: 0.12.6.1
add-wpgraphql-seo: 4.23.2

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL, WPGraphQL For ACF, ACF, etc.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions