feat: add WPGraphQL for ACF to the extensions page #3273
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this implement/fix? Explain your changes.
This adds WPGraphQL for ACF to the extensions page registry.
Smoke Tests
I've verified that basic functionality of the WPGraphQL for ACF plugin works.
With the following environment:
I imported the following .json file: https://github.com/wp-graphql/wpgraphql-acf/blob/develop/tests/_data/tests-acf-pro-kitchen-sink.json
After importing I modified the ACF Field Group settings to assign the group to post_type = page, so that any page would have these fields.
I was able to create a Page with many ACF Fields:
Then I was able to query the fields using GraphQL:
Here's the full query I used:
and the payload I received:
{ "data": { "page": { "id": "cG9zdDoyMQ==", "databaseId": 21, "title": "ACF Test Page", "content": "\n<p>This is a test page with ACF PRO fields</p>\n", "acfProKitchenSink": { "gallery": { "nodes": [ { "sourceUrl": "http://acf.local/wp-content/uploads/2025/01/favicon-32x32-1.png", "id": "cG9zdDoyMw==", "altText": "" }, { "sourceUrl": "http://acf.local/wp-content/uploads/2025/01/logo-wpgraphql.png", "id": "cG9zdDoyNA==", "altText": "" } ] }, "repeater": [ { "text": "Text Value", "gallery": { "nodes": [ { "sourceUrl": "http://acf.local/wp-content/uploads/2025/01/logo-wpgraphql.png", "id": "cG9zdDoyNA==", "altText": "" }, { "sourceUrl": "http://acf.local/wp-content/uploads/2025/01/favicon-32x32-1.png", "id": "cG9zdDoyMw==", "altText": "" } ] } } ], "flexibleContent": [ { "textField": "Text Field Value" }, { "gallery": { "nodes": [ { "sourceUrl": "http://acf.local/wp-content/uploads/2025/01/logo-wpgraphql.png", "id": "cG9zdDoyNA==", "altText": "" }, { "sourceUrl": "http://acf.local/wp-content/uploads/2025/01/favicon-32x32-1.png", "id": "cG9zdDoyMw==", "altText": "" } ] } }, { "repeater": [ { "text": "Text Value 1" }, { "text": "Text Value 2" } ] } ] } } } }Conclusion
The plugin largely works as intended, provides documentation and offers support via Github and Discord.