WPGraphQL for ACF is a FREE, open source WordPress plugin that exposes ACF Field Groups and Fields to the WPGraphQL Schema, enabling powerful decoupled solutions with modern frontends.
query GetPostWithAcfFields($id: ID!) { nodeByUri(uri: $id) { __typename uri ...on NodeWithTitle { title } ...on WithAcfMyFieldGroup { myFieldGroup { textField numberField } }}
Model Your Data with Advanced Custom Fields. Query it with GraphQL
All ACF Field Groups set to "show in graphql" are added to the GraphQL Schema, and share an "AcfFieldGroup" Interface
Couple your data needs with your components
Each ACF Field Group is represented by a GraphQL Type. And each Location where a field group is assigned implements a WithAcf* Interface. This allows ACF Field Groups to be easily coupled with components and re-used.
Model Your Data
Create ACF Field Groups
Each ACF Field Group that is set to "show_in_graphql" will be added to the GraphQL Schema and will have a corresponding GraphQL Object Type that implements the "AcfFieldGroup" Interface.
Fetch Your Data
Use GraphQL Queries and Fragments
WPGraphQL for ACF Adds GraphQL Object Types and Interfaces for each field group. This enables each component to specify the exact data it needs using GraphQL Queries and Fragments.
Render your data
Use the data from GraphQL in your Components
Components can use the data from GraphQL to render the data in the front-end. You can use any front-end framework you like, or even no framework at all)
Model Your Data
Each ACF Field Group that is set to "show_in_graphql" will be added to the GraphQL Schema and will have a corresponding GraphQL Object Type that implements the "AcfFieldGroup" Interface.
Fetch Your Data
WPGraphQL for ACF Adds GraphQL Object Types and Interfaces for each field group. This enables each component to specify the exact data it needs using GraphQL Queries and Fragments.
Render your data
Components can use the data from GraphQL to render the data in the front-end. You can use any front-end framework you like, or even no framework at all)
Support for a plethora of ACF Field Types
WPGraphQL for ACF has built-in support for ACF (FREE & PRO) field types, including repeaters, flexible content, clone fields and more. It also supports most field types of ACF Extended (FREE & PRO). For field types that are not natively supported, we have created an API that allows developers to add support for them.
Frequently Asked Questions
These are some common questions we get asked. If you have any other questions, please check out the documentation or join our Slack community.
Does this work with ACF Extended?
Yes! WPGraphQL for ACF allows you to query for (most) fields created with ACF Extended.Can I filter and sort queries by ACF Fields using WPGraphQL for ACF?
At this time WPGraphQL for ACF does not support filtering or sorting queries by ACF Fields. "Meta Queries" are often very expensive to execute, so we currently do not support filtering by ACF fields out of the box, but are exploring options for supporting it without the performance penalty.I think I found a bug, where do I report it?
If you think you found a bug, please open an issue on GitHub. The more details you provide in the issue, and the more clear your steps to reproduce are, the higher chances we will be able to help.
Can I use ACF Free or Pro with WPGraphQL for ACF?
Yes! WPGraphQL for ACF works great with ACF Free and Pro. The Pro version of ACF has some additional features, such as Flexible Content Fields, Repeater Fields and Options Pages that are supported by WPGraphQL for ACF.Do I have to use Faust.js to use WPGraphQL for ACF?
No! While this site is built using Fuast.js and Next.js, you can use WPGraphQL for ACF with any GraphQL client, including Apollo, Relay, Urql, etc.I have an ACF Extension that adds a new field type, will it work with WPGraphQL for ACF?
WPGraphQL for ACF supports the field types that come with ACF (Free and PRO) as well as the field typs in ACF Extended (Free and PRO). Support for additional field types can be added by using the "register_graphql_acf_field_type" API.Do I need WPGraphQL and ACF to be active to use this?
This plugin is a "bridge" plugin that brings functionality of ACF to WPGraphQL. Both WPGraphQL and ACF need to be installed and active in your WordPress installation for this plugin to work.
How much does WPGraphQL for ACF cost?
WPGraphQL for ACF is a FREE open-source plugin. The development is sponsored by WPEngine.Does WPGraphQL for ACF support GraphQL Mutations?
GraphQL Mutations are not yet supported. We are working on adding support for Mutations in the future. We are waiting for the GraphQL "@oneOf" directive to be merged into the GraphQL spec before we add support for Mutations.Does this work with Field Groups registered in PHP or JSON?
Yes! You can register ACF Field Groups and Fields using the Admin UI, PHP or JSON. WPGraphQL for ACF will detect the Field Groups and Fields and add them to the GraphQL Schema. If using PHP or JSON, you will need to set the "show_in_graphql" setting to "true" to expose the Field Group and Fields to the GraphQL Schema. There might be other settings that need attention at the field group or field level that might impact the schema or field resolution.