Skip to content

Ingest Errors with Flexible Content Field Groups and WPGraphQL for ACF 2.0.0+Β #244

@alex-mmp

Description

@alex-mmp

Description

I'm encountering an issue with the ingest step of my Gatsby project after upgrading WPGraphQL for ACF to version 2.0.0+. Specifically, when using flexible content field groups in my WordPress ACF setup, the ingest process fails. Without the flexible content field group the build works absolutely fine.

This seems to have been a regression between version 0.6.1 and 2.0.0.

Steps to reproduce

  1. Create a new WordPress installation.
  2. Install and activate WPGraphQL and WPGraphQL for ACF.
  3. Create a new ACF field group with a flexible content field.
  4. Create a new Gatsby project and install the necessary WPGraphQL packages.
  5. Configure the Gatsby project to connect to the WordPress site.
  6. Run npm run develop in the Gatsby project.

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

[
    {
        "key": "group_6720ab7193965",
        "title": "Builder",
        "fields": [
            {
                "key": "field_6720ab5d79ba3",
                "label": "Flex",
                "name": "flex",
                "aria-label": "",
                "type": "flexible_content",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "layouts": {
                    "layout_6720ab7b84ccf": {
                        "key": "layout_6720ab7b84ccf",
                        "name": "title",
                        "label": "First",
                        "display": "block",
                        "sub_fields": [
                            {
                                "key": "field_6720ab7379ba4",
                                "label": "Title",
                                "name": "title",
                                "aria-label": "",
                                "type": "text",
                                "instructions": "",
                                "required": 0,
                                "conditional_logic": 0,
                                "wrapper": {
                                    "width": "",
                                    "class": "",
                                    "id": ""
                                },
                                "default_value": "",
                                "maxlength": "",
                                "allow_in_bindings": 0,
                                "placeholder": "",
                                "prepend": "",
                                "append": "",
                                "show_in_graphql": 1,
                                "graphql_description": "",
                                "graphql_field_name": "title",
                                "graphql_non_null": 0
                            }
                        ],
                        "min": "",
                        "max": ""
                    }
                },
                "min": "",
                "max": "",
                "button_label": "Add Row",
                "show_in_graphql": 1,
                "graphql_description": "",
                "graphql_field_name": "flex",
                "graphql_non_null": 0
            }
        ],
        "location": [
            [
                {
                    "param": "post_type",
                    "operator": "==",
                    "value": "page"
                }
            ]
        ],
        "menu_order": 0,
        "position": "normal",
        "style": "default",
        "label_placement": "top",
        "instruction_placement": "label",
        "hide_on_screen": "",
        "active": true,
        "description": "",
        "show_in_rest": 0,
        "show_in_graphql": 1,
        "graphql_field_name": "builder",
        "map_graphql_types_from_location_rules": 0,
        "graphql_types": ""
    },
    {
        "key": "group_6720aa73ce30f",
        "title": "Test",
        "fields": [
            {
                "key": "field_6720aa603bdfe",
                "label": "Test Text",
                "name": "test_text",
                "aria-label": "",
                "type": "text",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "maxlength": "",
                "allow_in_bindings": 0,
                "placeholder": "",
                "prepend": "",
                "append": "",
                "show_in_graphql": 1,
                "graphql_description": "",
                "graphql_field_name": "testText",
                "graphql_non_null": 0
            }
        ],
        "location": [
            [
                {
                    "param": "post_type",
                    "operator": "==",
                    "value": "page"
                }
            ]
        ],
        "menu_order": 0,
        "position": "normal",
        "style": "default",
        "label_placement": "top",
        "instruction_placement": "label",
        "hide_on_screen": "",
        "active": true,
        "description": "",
        "show_in_rest": 0,
        "show_in_graphql": 1,
        "graphql_field_name": "test",
        "map_graphql_types_from_location_rules": 0,
        "graphql_types": ""
    }
]

Additional context

Here's a screen shot of the ingest error after making the builder field group.
image

WPGraphQL Version

1.28.1

WPGraphQL For ACF Version

2.0.0 - 2.4.1

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

6.3.9, Pro

WordPress Version

6.6.2

PHP Version

8.2.24

Additional enviornment details

No response

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