Exposes Advanced Custom Fields (ACF) data to the WPGraphQL schema for headless WordPress.
WPGraphQL for Advanced Custom Fields is a WordPress plugin that bridges Advanced Custom Fields (ACF) with the WPGraphQL GraphQL API. It automatically exposes ACF field groups and custom field data to the GraphQL schema, allowing developers to query structured content from headless WordPress setups. This solves the problem of accessing complex custom fields in decoupled architectures without custom REST endpoints.
WordPress developers building headless or decoupled websites, especially those using WPGraphQL and Advanced Custom Fields to manage structured content.
Developers choose this plugin because it seamlessly integrates ACF with WPGraphQL, eliminating the need for custom API development. It provides a declarative, opt-in approach to expose only intended fields, ensuring security and schema clarity while supporting a wide range of ACF field types.
WPGraphQL for Advanced Custom Fields
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically exposes ACF field groups to the WPGraphQL schema when configured with 'show_in_graphql', as demonstrated in both GUI settings and PHP code examples in the README.
Supports numerous ACF field types including text, image, repeater, and flexible content, with dedicated documentation for each field, enabling complex data queries in headless setups.
Allows exposure of ACF options pages to GraphQL for site-wide settings, enabling direct queries like `myOptionsPage { someCustomField }` as per the README example.
Fields are only exposed to GraphQL when explicitly set via 'show_in_graphql', preventing unintended data exposure and adhering to a secure, declarative approach highlighted in the philosophy.
The README explicitly warns that v2.0+ contains breaking changes and this repository is being archived, forcing users to upgrade cautiously and potentially refactor existing GraphQL queries.
Requires both WPGraphQL and ACF plugins as dependencies, and installation isn't available on WordPress.org, necessitating manual downloads from GitHub or Composer, adding to initial setup complexity.
As admitted in the README, some ACF location rules based on specific context (e.g., individual pages) aren't supported because they don't map cleanly to the static GraphQL schema, limiting flexibility.